Skip to content

Commit 97b7ab9

Browse files
authored
fix: Configuration to stop coercion of tz for entity_df (#3255)
add option to skip coercion Signed-off-by: ammarar <ammar.alrashed@gmail.com> Signed-off-by: ammarar <ammar.alrashed@gmail.com>
1 parent 086f279 commit 97b7ab9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sdk/python/feast/feature_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ def get_historical_features(
11111111

11121112
# Check that the right request data is present in the entity_df
11131113
if type(entity_df) == pd.DataFrame:
1114-
entity_df = utils.make_df_tzaware(cast(pd.DataFrame, entity_df))
1114+
if self.config.coerce_tz_aware:
1115+
entity_df = utils.make_df_tzaware(cast(pd.DataFrame, entity_df))
11151116
for fv in request_feature_views:
11161117
for feature in fv.features:
11171118
if feature.name not in entity_df.columns:

sdk/python/feast/repo_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ class RepoConfig(FeastBaseModel):
167167
feature values for entities that have already been written into the online store.
168168
"""
169169

170+
coerce_tz_aware: Optional[bool] = True
171+
""" If True, coerces entity_df timestamp columns to be timezone aware (to UTC by default). """
172+
170173
def __init__(self, **data: Any):
171174
super().__init__(**data)
172175

0 commit comments

Comments
 (0)