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