Skip to content

Commit 153fe89

Browse files
authored
fix: Pyarrow 15 imports & remove unused code (#2649)
Signed-off-by: Anton Kukushkin <[email protected]>
1 parent 3cd9601 commit 153fe89

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

awswrangler/_data_types.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -702,17 +702,12 @@ def pyarrow_schema_from_pandas(
702702

703703
def athena_types_from_pyarrow_schema(
704704
schema: pa.Schema,
705-
partitions: pyarrow.parquet.ParquetPartitions | None,
706705
ignore_null: bool = False,
707-
) -> tuple[dict[str, str], dict[str, str] | None]:
706+
) -> dict[str, str]:
708707
"""Extract the related Athena data types from any PyArrow Schema considering possible partitions."""
709708
columns_types: dict[str, str] = {str(f.name): pyarrow2athena(dtype=f.type, ignore_null=ignore_null) for f in schema}
710709
_logger.debug("columns_types: %s", columns_types)
711-
partitions_types: dict[str, str] | None = None
712-
if partitions is not None:
713-
partitions_types = {p.name: pyarrow2athena(p.dictionary.type, ignore_null=ignore_null) for p in partitions}
714-
_logger.debug("partitions_types: %s", partitions_types)
715-
return columns_types, partitions_types
710+
return columns_types
716711

717712

718713
def cast_pandas_with_athena_types(

awswrangler/s3/_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ def read_table_metadata(
280280
merged_schemas = _validate_schemas(schemas=schemas, validate_schema=False)
281281

282282
columns_types: dict[str, str] = _data_types.athena_types_from_pyarrow_schema(
283-
schema=merged_schemas, partitions=None, ignore_null=ignore_null
284-
)[0]
283+
schema=merged_schemas, ignore_null=ignore_null
284+
)
285285

286286
# Partitions
287287
partitions_types: dict[str, str] | None = None

0 commit comments

Comments
 (0)