Skip to content

Add compatibility for Dask 2021.06.0 #50

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

Merged
merged 6 commits into from
Jun 7, 2021
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
12 changes: 6 additions & 6 deletions dask_geopandas/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import geopandas
from geopandas.array import GeometryArray, GeometryDtype, from_shapely

DASK_2021_06 = str(dask.__version__) > LooseVersion("2021.05.0")
DASK_2021_06_0 = str(dask.__version__) >= LooseVersion("2021.06.0")

if DASK_2021_06:
from dask.dataframe.utils import make_meta
if DASK_2021_06_0:
from dask.dataframe.dispatch import make_meta_dispatch
from dask.dataframe.backends import _nonempty_index, meta_nonempty_dataframe
else:
from dask.dataframe.core import make_meta
from dask.dataframe.core import make_meta as make_meta_dispatch
from dask.dataframe.utils import _nonempty_index, meta_nonempty_dataframe


Expand All @@ -29,7 +29,7 @@
get_parallel_type.register(geopandas.GeoSeries, lambda _: GeoSeries)


@make_meta.register(BaseGeometry)
@make_meta_dispatch.register(BaseGeometry)
def make_meta_shapely_geometry(x, index=None):
return x

Expand Down Expand Up @@ -60,7 +60,7 @@ def _nonempty_geodataframe(x):
return geopandas.GeoDataFrame(df, crs=x.crs)


@make_meta.register((geopandas.GeoSeries, geopandas.GeoDataFrame))
@make_meta_dispatch.register((geopandas.GeoSeries, geopandas.GeoDataFrame))
def make_meta_geodataframe(df, index=None):
return df.head(0)

Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

import versioneer

install_requires = ["geopandas", "dask>=2.18.0", "distributed>=2.18.0"]
install_requires = [
"geopandas",
"dask>=2.18.0,!=2021.05.1",
"distributed>=2.18.0,!=2021.05.1",
]


setup(
Expand Down