Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix max_age changes not updating specs and add TQDM silencing flag #292

Merged
merged 1 commit into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions core/src/main/java/feast/core/model/FeatureSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
import feast.core.FeatureSetProto.EntitySpec;
import feast.core.FeatureSetProto.FeatureSetSpec;
import feast.core.FeatureSetProto.FeatureSpec;
import feast.core.SourceProto;
import feast.core.util.TypeConversion;
import feast.types.ValueProto.ValueType;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
Expand Down Expand Up @@ -68,7 +65,8 @@ public FeatureSet() {
super();
}

public FeatureSet(String name, int version, long maxAgeSeconds, List<Field> entities, List<Field> features,
public FeatureSet(String name, int version, long maxAgeSeconds, List<Field> entities,
List<Field> features,
Source source) {
this.id = String.format("%s:%s", name, version);
this.name = name;
Expand Down Expand Up @@ -137,7 +135,8 @@ public FeatureSetSpec toProto() throws InvalidProtocolBufferException {
*/
public boolean equalTo(FeatureSet other) throws InvalidProtocolBufferException {
return name.equals(other.getName()) && entities.equals(other.entities) && features
.equals(other.features) && source.equalTo(other.getSource());
.equals(other.features) && source.equalTo(other.getSource())
&& maxAgeSeconds == other.maxAgeSeconds;
}

@Override
Expand Down
9 changes: 8 additions & 1 deletion sdk/python/feast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,14 @@ def _apply_feature_set(self, feature_set: FeatureSet):
timeout=GRPC_CONNECTION_TIMEOUT_APPLY,
) # type: ApplyFeatureSetResponse
applied_fs = FeatureSet.from_proto(apply_fs_response.feature_set)
feature_set._update_from_feature_set(applied_fs, is_dirty=False)

if apply_fs_response.status == ApplyFeatureSetResponse.Status.CREATED:
print(f'Feature set updated/created: "{applied_fs.name}:{applied_fs.version}".')
feature_set._update_from_feature_set(applied_fs, is_dirty=False)
return
if apply_fs_response.status == ApplyFeatureSetResponse.Status.NO_CHANGE:
print(f'No change detected in feature set {feature_set.name}:{feature_set.version}')
return
except grpc.RpcError as e:
print(format_grpc_exception("ApplyFeatureSet", e.code(), e.details()))

Expand Down
4 changes: 3 additions & 1 deletion sdk/python/feast/feature_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ def ingest(
force_update: bool = False,
timeout: int = 5,
max_workers: int = CPU_COUNT,
disable_progress_bar: bool = False
):
pbar = tqdm(unit="rows", total=dataframe.shape[0])

pbar = tqdm(unit="rows", total=dataframe.shape[0], disable=disable_progress_bar)
q = Queue()
proc = Process(target=self._listener, args=(pbar, q))
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/basic/data.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
datetime,customer,daily_transactions,total_transactions
datetime,customer_id,daily_transactions,total_transactions
1570366527,1001,1.3,500
1570366536,1002,1.4,600