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: Configuration to stop coercion of tz for entity_df #3255

Merged
merged 1 commit into from
Sep 28, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -167,6 +167,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