Skip to content

Commit ad8067e

Browse files
committed
Fix max_age changes not updating specs and add TQDM silencing flag
1 parent 79eb4ab commit ad8067e

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

core/src/main/java/feast/core/model/FeatureSet.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
import feast.core.FeatureSetProto.EntitySpec;
66
import feast.core.FeatureSetProto.FeatureSetSpec;
77
import feast.core.FeatureSetProto.FeatureSpec;
8-
import feast.core.SourceProto;
9-
import feast.core.util.TypeConversion;
108
import feast.types.ValueProto.ValueType;
119
import java.util.ArrayList;
1210
import java.util.List;
13-
import java.util.Map;
1411
import javax.persistence.CascadeType;
1512
import javax.persistence.Column;
1613
import javax.persistence.Entity;
@@ -68,7 +65,8 @@ public FeatureSet() {
6865
super();
6966
}
7067

71-
public FeatureSet(String name, int version, long maxAgeSeconds, List<Field> entities, List<Field> features,
68+
public FeatureSet(String name, int version, long maxAgeSeconds, List<Field> entities,
69+
List<Field> features,
7270
Source source) {
7371
this.id = String.format("%s:%s", name, version);
7472
this.name = name;
@@ -137,7 +135,8 @@ public FeatureSetSpec toProto() throws InvalidProtocolBufferException {
137135
*/
138136
public boolean equalTo(FeatureSet other) throws InvalidProtocolBufferException {
139137
return name.equals(other.getName()) && entities.equals(other.entities) && features
140-
.equals(other.features) && source.equalTo(other.getSource());
138+
.equals(other.features) && source.equalTo(other.getSource())
139+
&& maxAgeSeconds == other.maxAgeSeconds;
141140
}
142141

143142
@Override

sdk/python/feast/client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,14 @@ def _apply_feature_set(self, feature_set: FeatureSet):
213213
timeout=GRPC_CONNECTION_TIMEOUT_APPLY,
214214
) # type: ApplyFeatureSetResponse
215215
applied_fs = FeatureSet.from_proto(apply_fs_response.feature_set)
216-
feature_set._update_from_feature_set(applied_fs, is_dirty=False)
216+
217+
if apply_fs_response.status == ApplyFeatureSetResponse.Status.CREATED:
218+
print(f'Feature set updated/created: "{applied_fs.name}:{applied_fs.version}".')
219+
feature_set._update_from_feature_set(applied_fs, is_dirty=False)
220+
return
221+
if apply_fs_response.status == ApplyFeatureSetResponse.Status.NO_CHANGE:
222+
print(f'No change detected in feature set {feature_set.name}:{feature_set.version}')
223+
return
217224
except grpc.RpcError as e:
218225
print(format_grpc_exception("ApplyFeatureSet", e.code(), e.details()))
219226

sdk/python/feast/feature_set.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,10 @@ def ingest(
305305
force_update: bool = False,
306306
timeout: int = 5,
307307
max_workers: int = CPU_COUNT,
308+
disable_progress_bar: bool = False
308309
):
309-
pbar = tqdm(unit="rows", total=dataframe.shape[0])
310+
311+
pbar = tqdm(unit="rows", total=dataframe.shape[0], disable=disable_progress_bar)
310312
q = Queue()
311313
proc = Process(target=self._listener, args=(pbar, q))
312314
try:

tests/e2e/basic/data.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
datetime,customer,daily_transactions,total_transactions
1+
datetime,customer_id,daily_transactions,total_transactions
22
1570366527,1001,1.3,500
33
1570366536,1002,1.4,600

0 commit comments

Comments
 (0)