You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hamilton.apache.org by "Thanatos9404 (via GitHub)" <gi...@apache.org> on 2026/10/18 13:25:49 UTC

[PR] Require pandera>=0.23 and un-xfail the dask series test [hamilton]

Thanatos9404 opened a new pull request, #1770:
URL: https://github.com/apache/hamilton/pull/1770

   Fixes #1279
   
   The `KeyError: 'dask'` comes from pandera rather than import order in Hamilton. Since dask 2025.1, dask-expr ships inside dask, so a dask series is a `dask.dataframe.dask_expr._collection.Series`. pandera before 0.23 maps only the old top-level `dask_expr` module name to its dask backend, and `SeriesSchema.validate` looks up the backend by type first, so it fails. `DataFrameSchema.validate` maps over the partitions before any lookup, which is why only the series test broke. Calling pandera directly on a dask series fails the same way with pandera 0.22.1 and dask 2025.1.0. pandera fixed the lookup in 0.23.0 (the `dask` backend mapping added in unionai-oss/pandera#1898), which is why the xfailed test already passes in CI.
   
   ## Changes
   
   - `pandera>=0.23` for the `pandera` extra and the `docs` group, and `pandera[dask]>=0.23` in the `test` group and `tests/integrations/pandera/requirements.txt`.
   - Removed the xfail from `test_pandera_decorator_dask_series`.
   - Added a test where only the last of two partitions of a dask series breaks the schema, so the series validator is checked to compute every partition.
   
   No code changes in Hamilton itself.
   
   ## How I tested this
   
   `tests/integrations/pandera` on Python 3.12:
   
   - pandera 0.22.1 with dask 2025.1.0: both dask series tests fail with `KeyError: 'dask'`, which is why the floor is needed.
   - pandera 0.23.0 (the new minimum) with dask 2025.1.0: all pass.
   - pandera 0.34.1 with dask 2026.8.0: all pass, as do `tests/test_default_data_quality.py`, `tests/function_modifiers/test_validation.py` and `tests/test_end_to_end.py`.
   
   `uv pip compile pyproject.toml --extra pandera --group test` still resolves on Python 3.10 and 3.14, and `prek run --files` passes on the changed files.
   
   ## Notes
   
   pandera 0.23 itself requires pandas>=2.1.1, so the `pandera` extra now implies that floor too. Plain Hamilton is not affected.
   
   If you need to keep supporting pandera < 0.23, I have a small alternative that validates dask series partition by partition in `PanderaSeriesSchemaValidator` instead of raising the floor, and can open that instead.
   
   ## Checklist
   
   - [x] PR has an informative and human-readable title (this will be pulled into the release notes)
   - [x] Changes are limited to a single goal (no scope creep)
   - [x] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
   - [x] Any _change_ in functionality is tested
   - [x] New functions are documented (with a description, list of inputs, and expected output)
   - [x] Placeholder code is flagged / future TODOs are captured in comments
   - [ ] Project documentation has been updated if adding/changing functionality. (No user-facing change beyond the dependency floor.)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Require pandera>=0.27 and un-xfail the dask series test [hamilton]

Posted by "Thanatos9404 (via GitHub) via notifications" <no...@hamilton.apache.org>.
Thanatos9404 commented on PR #1770:
URL: https://github.com/apache/hamilton/pull/1770#issuecomment-6747579544

   Thanks, you're right. I merged main and raised every pin to 0.27: 0.23 to 0.25 fail to import `pandera.typing.polars` with polars 2, and 0.26.0 and 0.26.1 fail pandas checks on Python 3.14, while 0.27.0 passes `tests/integrations` on 3.11 to 3.14 with polars 2.1 and pandas 3.1. The `pandas` extra keeps pandera's own pandas and numpy floors, and a new CI step reruns the integration tests with pandera 0.27.0, so the floor itself stays tested.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org