Skip to content

Uninformative AttributeError for aggregation methods #288

Open
@chandley564

Description

@chandley564

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions