Skip to content

Commit f82b7e1

Browse files
2.12.0 release fix (#957)
* Preparing release 2.12.0 * Nested try block for argument not supported in pyarrow 2 Co-authored-by: kukushking <[email protected]>
1 parent df1c406 commit f82b7e1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

awswrangler/s3/_read_parquet.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,15 @@ def _pyarrow_parquet_file_wrapper(
3838
source: Any, read_dictionary: Optional[List[str]] = None, coerce_int96_timestamp_unit: Optional[str] = None
3939
) -> pyarrow.parquet.ParquetFile:
4040
try:
41-
return pyarrow.parquet.ParquetFile(
42-
source=source, read_dictionary=read_dictionary, coerce_int96_timestamp_unit=coerce_int96_timestamp_unit
43-
)
41+
try:
42+
return pyarrow.parquet.ParquetFile(
43+
source=source, read_dictionary=read_dictionary, coerce_int96_timestamp_unit=coerce_int96_timestamp_unit
44+
)
45+
except TypeError as ex:
46+
if "got an unexpected keyword argument" in str(ex):
47+
_logger.warning("coerce_int96_timestamp_unit is not supported in pyarrow 2 and below")
48+
return pyarrow.parquet.ParquetFile(source=source, read_dictionary=read_dictionary)
49+
raise
4450
except pyarrow.ArrowInvalid as ex:
4551
if str(ex) == "Parquet file size is 0 bytes":
4652
_logger.warning("Ignoring empty file...xx")

0 commit comments

Comments
 (0)