Skip to content

Commit 342464f

Browse files
jparkzzzseta
authored andcommitted
fix: Allow trancated timestamps when converting (feast-dev#3861)
Signed-off-by: Attila Toth <hello@attilatoth.dev>
1 parent 7b21c84 commit 342464f

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

sdk/python/feast/infra/offline_stores/bigquery.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ def write_logged_features(
356356
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
357357
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
358358
pyarrow.parquet.write_table(
359-
table=data, where=parquet_temp_file, coerce_timestamps="us"
359+
table=data,
360+
where=parquet_temp_file,
361+
coerce_timestamps="us",
362+
allow_truncated_timestamps=True,
360363
)
361364

362365
parquet_temp_file.seek(0)
@@ -407,7 +410,10 @@ def offline_write_batch(
407410
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
408411
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
409412
pyarrow.parquet.write_table(
410-
table=table, where=parquet_temp_file, coerce_timestamps="us"
413+
table=table,
414+
where=parquet_temp_file,
415+
coerce_timestamps="us",
416+
allow_truncated_timestamps=True,
411417
)
412418

413419
parquet_temp_file.seek(0)

sdk/python/feast/infra/utils/aws_utils.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,12 @@ def upload_arrow_table_to_redshift(
353353
with tempfile.TemporaryFile(suffix=".parquet") as parquet_temp_file:
354354
# In Pyarrow v13.0, the parquet version was upgraded to v2.6 from v2.4.
355355
# Set the coerce_timestamps to "us"(microseconds) for backward compatibility.
356-
pq.write_table(table, parquet_temp_file, coerce_timestamps="us")
356+
pq.write_table(
357+
table,
358+
parquet_temp_file,
359+
coerce_timestamps="us",
360+
allow_truncated_timestamps=True,
361+
)
357362
parquet_temp_file.seek(0)
358363
s3_resource.Object(bucket, key).put(Body=parquet_temp_file)
359364

0 commit comments

Comments
 (0)