Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMPAT: specify shuffle=False in dissolve #229

Merged
merged 3 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion continuous_integration/envs/310-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
dependencies:
# required dependencies
- python=3.10
- dask=2022.06.0
- dask=2022.10.0
- distributed
- geopandas
- pygeos
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/envs/39-no-optional-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
dependencies:
# required dependencies
- python=3.9
- dask=2022.5.2
- dask=2022.6.0
- distributed
- geopandas
- pygeos
Expand Down
13 changes: 11 additions & 2 deletions dask_geopandas/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from packaging.version import Version

import numpy as np
import pandas as pd

import dask
import dask.dataframe as dd
import dask.array as da
from dask.dataframe.core import _emulate, map_partitions, elemwise, new_dd_object
Expand All @@ -20,6 +23,9 @@
import dask_geopandas


DASK_2022_8_1 = Version(dask.__version__) >= Version("2022.8.1")


def _set_crs(df, crs, allow_override):
"""Return a new object with crs set to ``crs``"""
return df.set_crs(crs, allow_override=allow_override)
Expand Down Expand Up @@ -638,9 +644,12 @@ def union(block):
else:
data_agg = {col: aggfunc for col in self.columns.drop(drop)}
data_agg[self.geometry.name] = merge_geometries
# dask 2022.8.1 added shuffle keyword, enabled by default if split_out > 1
# starting with dask 2022.9.1, but geopandas doesn't yet work with shuffle
# https://github.com/geopandas/dask-geopandas/pull/229
agg_kwargs = {"shuffle": False} if DASK_2022_8_1 else {}
aggregated = self.groupby(by=by, **kwargs).agg(
data_agg,
split_out=split_out,
data_agg, split_out=split_out, **agg_kwargs
)
return aggregated.set_crs(self.crs)

Expand Down