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, update pins #171

Merged
merged 22 commits into from
Feb 13, 2025

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.61%. Comparing base (e58fa82) to head (7dbf6a0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
spatialpandas/dask.py 82.60% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
- Coverage   77.74%   77.61%   -0.14%     
==========================================
  Files          50       50              
  Lines        4871     4865       -6     
==========================================
- Hits         3787     3776      -11     
- Misses       1084     1089       +5     

☔ 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.

@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.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, that seems like a dask configuration problem, probably not for us to worry about.

'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

@hoxbro hoxbro added this to the v0.5.0 milestone Feb 12, 2025
@hoxbro hoxbro changed the title compat: Support dask query-planning, drop Python 3.9 compat!: Support dask query-planning, drop Python 3.9 Feb 12, 2025
]

[tool.ruff]
fix = true
line-length = 100
target-version = "py39" # TODO: Remove in follow up PR
Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #173

@hoxbro hoxbro changed the title compat!: Support dask query-planning, drop Python 3.9 compat!: Support dask query-planning, drop Python 3.9, update pins Feb 12, 2025
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks fairly straightforward thankfully. Thanks for doing this!

@hoxbro hoxbro merged commit 99dbd6f into main Feb 13, 2025
12 checks passed
@hoxbro hoxbro deleted the dask_expr branch February 13, 2025 10:52
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
2 participants