geopandas / dask-geopandas

Parallel GeoPandas with Dask
https://dask-geopandas.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
503 stars 44 forks source link

FutureWarning for index_parts parameter in GeoDataFrame.explode() #245

Closed ebkurtz closed 6 months ago

ebkurtz commented 1 year ago

I am calling the .explode() method on a dask GeoDataFrame which results in the warning:

FutureWarning: Currently, index_parts defaults to True, but in the future, it will default to False to be consistent with Pandas. Use index_parts=True to keep the current behavior and True/False to silence the warning.

I tried passing index_parts=False which results in an error:

TypeError: _Frame.explode() got an unexpected keyword argument 'index_parts'

Is it possible to have the method accept an index_parts argument to silence the warning? I believe this is the relevant piece of code, line 377 in core.py:

@derived_from(geopandas.geodataframe.GeoDataFrame)
def explode(self):
    return self.map_partitions(self._partition_type.explode, enforce_metadata=False)

Willing to help out with code changes, just wanted to see what the approach should be.

martinfleis commented 1 year ago

Yes, we should mirror the api from geopandas. Which means exposing additional keywords here.

ebkurtz commented 1 year ago

Great, I will make a fork and attempt a fix.

jorisvandenbossche commented 6 months ago

Closed by https://github.com/geopandas/dask-geopandas/pull/246