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: Support dask query-planning, drop Python 3.9 #171

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Jan 30, 2025

Resolves #146
Resolves #169

I don't want to support the legacy method, so I'm pinning to 2025.1, the first version with the dask-expr part of the dask library. This version only supports Python 3.10 and forward.

I haven't done any performance benchmarks. This is only to get spatialpandas to work with dask going forward.

reference: https://docs.dask.org/en/stable/dataframe-extend.html

The main functionality has been tested for both HoloViews and Datashader here:

@hoxbro hoxbro changed the title compat: Support dask query-planning compat: Support dask query-planning, drop Python 3.9 Jan 31, 2025
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.62%. Comparing base (e58fa82) to head (6d5a3de).

Files with missing lines Patch % Lines
spatialpandas/dask.py 83.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
- Coverage   77.74%   77.62%   -0.12%     
==========================================
  Files          50       50              
  Lines        4871     4872       +1     
==========================================
- Hits         3787     3782       -5     
- Misses       1084     1090       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -13,25 +13,22 @@
from dask import delayed
from dask.dataframe.core import get_parallel_type
from dask.dataframe.extensions import make_array_nonempty
from dask.dataframe.partitionquantiles import partition_quantiles
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

USE_PYGEOS = '0'

[environments]
test-39 = ["py39", "test-core", "test", "test-task", "example", "test-example"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dask 2025.1 only supports Python 3.10.

spatialpandas/io/parquet.py Outdated Show resolved Hide resolved
@hoxbro
Copy link
Member Author

hoxbro commented Jan 31, 2025

I have tested a dev release with HoloViews and Datashader, and both test suites passed.

@hoxbro hoxbro marked this pull request as ready for review January 31, 2025 16:15
@@ -86,6 +81,9 @@ test-unit = 'pytest spatialpandas/tests -n logical --dist loadgroup'
[feature.test-example.dependencies]
nbval = "*"

[feature.test-example.activation.env]
DASK_SCHEDULER = "single-threaded"
Copy link
Member Author

@hoxbro hoxbro Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to try to avoid this kind of error (which also happens on main)

image

edit: It still seems to fail, but I will let it be for now.

'pandas',
'pyarrow >=10',
'pandas >=2.0',
'pyarrow >=14.0.1',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two are part of the minimum dependencies of dask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot import spatialpandas.dask.DaskGeoDataFrame Support dask-expr DataFrame
1 participant