Skip to content

Commit 95066ea

Browse files
kevjumbaadchia
authored andcommitted
fix: Fix Shopify timestamp bug and add warnings to help with debugging entity registration (#3191)
* Fix Signed-off-by: Kevin Zhang <[email protected]> * Foix lint Signed-off-by: Kevin Zhang <[email protected]> Signed-off-by: Kevin Zhang <[email protected]>
1 parent 5dba4a3 commit 95066ea

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sdk/python/feast/feature_view.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ def from_proto(cls, feature_view_proto: FeatureViewProto):
409409
for field_proto in feature_view_proto.spec.entity_columns
410410
]
411411

412+
if len(feature_view.entities) != len(feature_view.entity_columns):
413+
warnings.warn(
414+
f"There are some mismatches in your feature view's registered entities. Please check if you have applied your entities correctly."
415+
f"Entities: {feature_view.entities} vs Entity Columns: {feature_view.entity_columns}"
416+
)
417+
412418
# FeatureViewProjections are not saved in the FeatureView proto.
413419
# Create the default projection.
414420
feature_view.projection = FeatureViewProjection.from_definition(feature_view)

sdk/python/feast/type_map.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ def _python_datetime_to_int_timestamp(
320320
int_timestamps.append(int(value.ToSeconds()))
321321
elif isinstance(value, np.datetime64):
322322
int_timestamps.append(value.astype("datetime64[s]").astype(np.int_))
323+
elif isinstance(value, type(np.nan)):
324+
int_timestamps.append(NULL_TIMESTAMP_INT_VALUE)
323325
else:
324326
int_timestamps.append(int(value))
325327
return int_timestamps

0 commit comments

Comments
 (0)