Skip to content

Commit

Permalink
fix: Configuration to stop coercion of tz for entity_df (feast-dev#3255)
Browse files Browse the repository at this point in the history
add option to skip coercion

Signed-off-by: ammarar <[email protected]>

Signed-off-by: ammarar <[email protected]>
  • Loading branch information
ammarar authored and adchia committed Sep 30, 2022
1 parent 55e28e2 commit fdc8d67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,8 @@ def get_historical_features(

# Check that the right request data is present in the entity_df
if type(entity_df) == pd.DataFrame:
entity_df = utils.make_df_tzaware(cast(pd.DataFrame, entity_df))
if self.config.coerce_tz_aware:
entity_df = utils.make_df_tzaware(cast(pd.DataFrame, entity_df))
for fv in request_feature_views:
for feature in fv.features:
if feature.name not in entity_df.columns:
Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ class RepoConfig(FeastBaseModel):
feature values for entities that have already been written into the online store.
"""

coerce_tz_aware: Optional[bool] = True
""" If True, coerces entity_df timestamp columns to be timezone aware (to UTC by default). """

def __init__(self, **data: Any):
super().__init__(**data)

Expand Down

0 comments on commit fdc8d67

Please sign in to comment.