geopandas / dask-geopandas

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

Uninformative AttributeError for aggregation methods #288

Open chandley564 opened 4 months ago

chandley564 commented 4 months ago

Issue

Since the change to dask-expr as a backend for DataFrames aggregation methods (like dissolve) raise an uninformative attribute error. The methods are still avaliable using a legacy dataframe (accessed through dask_df.to_legacy_dataframe()) so the error messaging could be updated to reflect this. Also, dask-expr documentation mentions that these methods are not supported, however I couldn't find any reference to the change in the dask-geopandas documentation.

Example

import geopandas as gpd
import dask_geopandas as dgpd

path_to_gdf = ...

gdf = gpd.read_file(path_to_gdf)
dask_gdf = dgpd.from_geopandas(gdf, npartitions=20)
dissolved = dask_gdf.dissolve()

Output

AttributeError: 'DataFrame' object has no attribute 'dissolve'

Enviroment

dask

Name: dask Version: 2024.4.0 Summary: Parallel PyData with Task Scheduling Home-page: Author: Author-email: License: BSD-3-Clause Location: ... Requires: click, cloudpickle, fsspec, importlib-metadata, packaging, partd, pyyaml, toolz Required-by: dask-expr, dask-geopandas, dask-image, datacube, datashader, distributed, nlm, odc-stac, stackstac

dask-geopandas

Version: 0.3.1 Summary: Parallel GeoPandas with Dask Home-page: https://github.com/geopandas/dask-geopandas Author: Author-email: License: BSD Location: ... Requires: dask, distributed, geopandas, packaging Required-by: