Skip to content

Commit

Permalink
Remove pandas 1.2 compability
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Feb 3, 2025
1 parent 2ffea47 commit 4ccf675
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions spatialpandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
to_parquet as dd_to_parquet,
)
from dask.utils import natural_sort_key
from packaging.version import Version
from pandas.io.parquet import to_parquet as pd_to_parquet
from pyarrow.parquet import ParquetDataset, ParquetFile, read_metadata

Expand All @@ -31,9 +30,6 @@
validate_coerce_filesystem,
)

# improve pandas compatibility, based on geopandas _compat.py
PANDAS_GE_12 = Version(pd.__version__) >= Version("1.2.0")


def _load_parquet_pandas_metadata(
path,
Expand Down Expand Up @@ -91,15 +87,10 @@ def to_parquet(
"compression": compression,
"filesystem": filesystem,
"index": index,
"storage_options": storage_options,
**kwargs,
}

if PANDAS_GE_12:
to_parquet_args.update({"storage_options": storage_options})
elif filesystem is None:
filesystem = validate_coerce_filesystem(path, filesystem, storage_options)
to_parquet_args.update({"filesystem": filesystem})

pd_to_parquet(**to_parquet_args)


Expand Down

0 comments on commit 4ccf675

Please sign in to comment.