Skip to content

Commit

Permalink
2.12.0 release fix (#957)
Browse files Browse the repository at this point in the history
* Preparing release 2.12.0

* Nested try block for argument not supported in pyarrow 2

Co-authored-by: kukushking <3997468+kukushking@users.noreply.github.com>
  • Loading branch information
jaidisido and kukushking authored Oct 13, 2021
1 parent df1c406 commit f82b7e1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions awswrangler/s3/_read_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ def _pyarrow_parquet_file_wrapper(
source: Any, read_dictionary: Optional[List[str]] = None, coerce_int96_timestamp_unit: Optional[str] = None
) -> pyarrow.parquet.ParquetFile:
try:
return pyarrow.parquet.ParquetFile(
source=source, read_dictionary=read_dictionary, coerce_int96_timestamp_unit=coerce_int96_timestamp_unit
)
try:
return pyarrow.parquet.ParquetFile(
source=source, read_dictionary=read_dictionary, coerce_int96_timestamp_unit=coerce_int96_timestamp_unit
)
except TypeError as ex:
if "got an unexpected keyword argument" in str(ex):
_logger.warning("coerce_int96_timestamp_unit is not supported in pyarrow 2 and below")
return pyarrow.parquet.ParquetFile(source=source, read_dictionary=read_dictionary)
raise
except pyarrow.ArrowInvalid as ex:
if str(ex) == "Parquet file size is 0 bytes":
_logger.warning("Ignoring empty file...xx")
Expand Down

0 comments on commit f82b7e1

Please sign in to comment.