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: Allow trancated timestamps when converting #3861

Merged
merged 1 commit into from
Jan 19, 2024
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
10 changes: 8 additions & 2 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ def write_logged_features(
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
pyarrow.parquet.write_table(
table=data, where=parquet_temp_file, coerce_timestamps="us"
table=data,
where=parquet_temp_file,
coerce_timestamps="us",
allow_truncated_timestamps=True,
)

parquet_temp_file.seek(0)
Expand Down Expand Up @@ -407,7 +410,10 @@ def offline_write_batch(
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
pyarrow.parquet.write_table(
table=table, where=parquet_temp_file, coerce_timestamps="us"
table=table,
where=parquet_temp_file,
coerce_timestamps="us",
allow_truncated_timestamps=True,
)

parquet_temp_file.seek(0)
Expand Down
7 changes: 6 additions & 1 deletion sdk/python/feast/infra/utils/aws_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,12 @@ def upload_arrow_table_to_redshift(
with tempfile.TemporaryFile(suffix=".parquet") as parquet_temp_file:
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
pq.write_table(table, parquet_temp_file, coerce_timestamps="us")
pq.write_table(
table,
parquet_temp_file,
coerce_timestamps="us",
allow_truncated_timestamps=True,
)
parquet_temp_file.seek(0)
s3_resource.Object(bucket, key).put(Body=parquet_temp_file)

Expand Down
Loading