File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments