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

Small fixes for created_timestamp #1468

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions sdk/python/feast/infra/offline_stores/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ def pull_latest_from_table_or_query(
source_df[event_timestamp_column] = source_df[event_timestamp_column].apply(
lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc)
)
source_df[created_timestamp_column] = source_df[created_timestamp_column].apply(
lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc)
)
if created_timestamp_column:
source_df[created_timestamp_column] = source_df[
created_timestamp_column
].apply(lambda x: x if x.tz is not None else x.replace(tzinfo=pytz.utc))

ts_columns = (
[event_timestamp_column, created_timestamp_column]
if created_timestamp_column is not None
if created_timestamp_column
else [event_timestamp_column]
)

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _coerce_datetime(ts):
)
event_timestamp = _coerce_datetime(row[event_timestamp_idx])

if feature_view.input.created_timestamp_column is not None:
if feature_view.input.created_timestamp_column:
created_timestamp_idx = table.column_names.index(
feature_view.input.created_timestamp_column
)
Expand Down