Skip to content

Commit a74f9d8

Browse files
authored
Add compatibility for Dask 2021.06.0 (#70)
1 parent 9717fa7 commit a74f9d8

File tree

3 files changed

+22
-34
lines changed

3 files changed

+22
-34
lines changed

.github/workflows/test.yml

+7-12
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ jobs:
2222
python-version: 3.6
2323
- os: macos-latest
2424
python-version: 3.8
25-
timeout-minutes: 40
25+
# Fiona for Python 3.6 on Windows has build issues
26+
# See https://github.com/conda-forge/fiona-feedstock/issues/171 for more details
27+
- os: windows-latest
28+
python-version: 3.6
29+
timeout-minutes: 60
2630
defaults:
2731
run:
2832
shell: bash -l {0}
2933
env:
3034
PYTHON_VERSION: ${{ matrix.python-version }}
31-
CHANS_DEV: "-c pyviz/label/dev"
32-
CHANS_OSX: "-c pyviz/label/dev -c conda-forge"
35+
CHANS_DEV: "-c conda-forge -c pyviz/label/dev"
3336
CHANS: "-c pyviz"
3437
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3538
steps:
@@ -42,6 +45,7 @@ jobs:
4245
- uses: conda-incubator/setup-miniconda@v2
4346
with:
4447
miniconda-version: "latest"
48+
python-version: ${{ matrix.python-version }}
4549
- name: Fetch
4650
run: git fetch --prune --tags
4751
- name: conda setup
@@ -50,21 +54,12 @@ jobs:
5054
conda install -c pyviz "pyctdev>=0.5"
5155
doit ecosystem_setup
5256
doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }}
53-
- name: doit develop_install osx
54-
if: contains(matrix.os, 'macos')
55-
run: |
56-
eval "$(conda shell.bash hook)"
57-
conda activate test-environment
58-
doit develop_install ${{ env.CHANS_OSX }} -o tests
59-
pip install hilbertcurve
6057
- name: doit develop_install
61-
if: (!contains(matrix.os, 'macos'))
6258
run: |
6359
eval "$(conda shell.bash hook)"
6460
conda activate test-environment
6561
conda list
6662
doit develop_install ${{ env.CHANS_DEV }} -o tests
67-
pip install hilbertcurve
6863
- name: doit env_capture
6964
run: |
7065
eval "$(conda shell.bash hook)"

setup.py

+7-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import sys
2-
31
import param
2+
43
from setuptools import find_packages, setup
54

65
extras_require = {
76
'tests': [
87
'codecov',
98
'flake8',
10-
'geopandas',
9+
'hilbertcurve',
10+
'geopandas-base',
1111
'hypothesis',
1212
'pytest-cov',
1313
'pytest',
@@ -29,27 +29,15 @@
2929
install_requires = [
3030
'fsspec',
3131
'numba',
32-
'pandas>=0.25',
32+
'pandas >=0.25',
3333
'param',
34-
'pyarrow>=0.15',
34+
'pyarrow >=1.0',
3535
'python-snappy',
3636
'retrying',
37+
'numpy',
38+
'dask[complete] >=2.0'
3739
]
3840

39-
# Checking for platform explicitly because
40-
# pyctdev does not handle dependency conditions
41-
# such as 'numpy<1.20;platform_system=="Darwin"'
42-
if sys.platform == 'darwin':
43-
install_requires.extend([
44-
'dask[complete]>=2.0,<2020.12',
45-
'numpy<1.20',
46-
])
47-
else:
48-
install_requires.extend([
49-
'dask[complete]>=2.0',
50-
'numpy',
51-
])
52-
5341
setup_args = dict(
5442
name='spatialpandas',
5543
version=param.version.get_setup_version(

spatialpandas/dask.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
from dask import delayed
1616
from dask.dataframe.core import get_parallel_type
1717
from dask.dataframe.partitionquantiles import partition_quantiles
18-
from dask.dataframe.utils import make_array_nonempty, make_meta, meta_nonempty
18+
from dask.dataframe.extensions import make_array_nonempty
19+
try:
20+
from dask.dataframe.dispatch import make_meta_dispatch
21+
from dask.dataframe.backends import meta_nonempty
22+
except ImportError:
23+
from dask.dataframe.utils import make_meta as make_meta_dispatch, meta_nonempty
1924

2025
from .geodataframe import GeoDataFrame
2126
from .geometry.base import GeometryDtype, _BaseCoordinateIndexer
@@ -99,7 +104,7 @@ def persist(self, **kwargs):
99104
)
100105

101106

102-
@make_meta.register(GeoSeries)
107+
@make_meta_dispatch.register(GeoSeries)
103108
def make_meta_series(s, index=None):
104109
result = s.head(0)
105110
if index is not None:
@@ -546,7 +551,7 @@ def __getitem__(self, key):
546551
return result
547552

548553

549-
@make_meta.register(GeoDataFrame)
554+
@make_meta_dispatch.register(GeoDataFrame)
550555
def make_meta_dataframe(df, index=None):
551556
result = df.head(0)
552557
if index is not None:

0 commit comments

Comments
 (0)