@@ -342,9 +342,7 @@ def athena2pyarrow(dtype: str) -> pa.DataType: # pylint: disable=too-many-retur
342342 raise exceptions .UnsupportedType (f"Unsupported Athena type: { dtype } " )
343343
344344
345- def athena2pandas (
346- dtype : str , dtype_backend : Optional [str ] = None
347- ) -> str : # pylint: disable=too-many-branches,too-many-return-statements
345+ def athena2pandas (dtype : str , dtype_backend : Optional [str ] = None ) -> str : # pylint: disable=too-many-return-statements
348346 """Athena to Pandas data types conversion."""
349347 dtype = dtype .lower ()
350348 if dtype == "tinyint" :
@@ -493,24 +491,24 @@ def pyarrow_types_from_pandas( # pylint: disable=too-many-branches,too-many-sta
493491 cols : List [str ] = []
494492 cols_dtypes : Dict [str , Optional [pa .DataType ]] = {}
495493 for name , dtype in df .dtypes .to_dict ().items ():
496- dtype = str (dtype )
494+ dtype_str = str (dtype )
497495 if name in ignore_cols :
498496 cols_dtypes [name ] = None
499- elif dtype == "Int8" :
497+ elif dtype_str == "Int8" :
500498 cols_dtypes [name ] = pa .int8 ()
501- elif dtype == "Int16" :
499+ elif dtype_str == "Int16" :
502500 cols_dtypes [name ] = pa .int16 ()
503- elif dtype == "Int32" :
501+ elif dtype_str == "Int32" :
504502 cols_dtypes [name ] = pa .int32 ()
505- elif dtype == "Int64" :
503+ elif dtype_str == "Int64" :
506504 cols_dtypes [name ] = pa .int64 ()
507- elif dtype == "float32" :
505+ elif dtype_str == "float32" :
508506 cols_dtypes [name ] = pa .float32 ()
509- elif dtype == "float64" :
507+ elif dtype_str == "float64" :
510508 cols_dtypes [name ] = pa .float64 ()
511- elif dtype == "string" :
509+ elif dtype_str == "string" :
512510 cols_dtypes [name ] = pa .string ()
513- elif dtype == "boolean" :
511+ elif dtype_str == "boolean" :
514512 cols_dtypes [name ] = pa .bool_ ()
515513 else :
516514 cols .append (name )
0 commit comments