Skip to content

Expression not assigned - #10507

Merged
dcherian merged 3 commits into
pydata:mainfrom
DimitriPapadopoulos:PYL-W0106
Jul 9, 2025
Merged

Expression not assigned#10507
dcherian merged 3 commits into
pydata:mainfrom
DimitriPapadopoulos:PYL-W0106

Conversation

@DimitriPapadopoulos

Copy link
Copy Markdown
Contributor
  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

Comment threadxarray/tests/test_dask.py
Comment threadxarray/tests/test_dask.py Outdated
unified = obj.unify_chunks()
assert_identical(obj, unified) and obj is not obj.unify_chunks()
assert_identical(obj, unified)
# assert obj is not obj.unify_chunks()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
# assert obj is not obj.unify_chunks()
assertobjisnotobj.unify_chunks()

I think this may be right

@DimitriPapadopoulosDimitriPapadopoulosJul 7, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The test doesn't work, that's why it has been commented out. I should probably improve the comment in commit 5f93e2d.

Besides I think it should have been:

Suggested change
# assert obj is not obj.unify_chunks()
assertobjisnotunified

@DimitriPapadopoulosDimitriPapadopoulosJul 8, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Uncommenting the test demonstrates the CI issue:

=========================== short test summary info ============================
FAILED xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>0-obj0] - assert <xarray.Dataset> Size: 9kB\nDimensions: (x: 10, y: 20, z: 4)\nCoordinates:\n * x (x) int64 80B 0 1 2 3 4 5 6 7 8...2B 1 1 1 1\n e (x, y) int64 2kB 100 101 102 103 104 105 ... 124 125 126 127 128\nAttributes:\n test: test is not <xarray.Dataset> Size: 9kB\nDimensions: (x: 10, y: 20, z: 4)\nCoordinates:\n * x (x) int64 80B 0 1 2 3 4 5 6 7 8...2B 1 1 1 1\n e (x, y) int64 2kB 100 101 102 103 104 105 ... 124 125 126 127 128\nAttributes:\n test: test
FAILED xarray/tests/test_dask.py::test_unify_chunks_shallow_copy[<lambda>0-obj1] - AssertionError: assert <xarray.DataArray 'a' (x: 10, y: 20)> Size: 2kB\narray([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1....2 14 16 18\n cxy (x, y) int64 2kB 0 0 0 0 0 0 0 ... 1026 1035 1044 1053 1062 1071\nAttributes:\n test: test is not <xarray.DataArray 'a' (x: 10, y: 20)> Size: 2kB\narray([[1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1....2 14 16 18\n cxy (x, y) int64 2kB 0 0 0 0 0 0 0 ... 1026 1035 1044 1053 1062 1071\nAttributes:\n test: test
= 2 failed, 19121 passed, 1041 skipped, 195 xfailed, 33 xpassed, 2864 warnings in 348.89s (0:05:48) =
Error: Process completed with exit code 1.

See for example https://github.com/pydata/xarray/actions/runs/16135835929/job/45531837533?pr=10507.

@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review July 7, 2025 17:38
I guess the `and` was meant to disable the assertion.
Commenting it out with `#` instead.
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as draft July 8, 2025 06:36
@DimitriPapadopoulos
DimitriPapadopoulos marked this pull request as ready for review July 8, 2025 07:06
@dcherian
dcherian merged commit c43a374 into pydata:mainJul 9, 2025
@DimitriPapadopoulos
DimitriPapadopoulos deleted the PYL-W0106 branch July 9, 2025 15:13
dcherian added a commit to jsignell/xarray that referenced this pull request Jul 18, 2025
* main: (94 commits)
Restructure API documentation into organized sections (pydata#10540)
Fix convert calendar with different dimension name (pydata#10544)
Fix kerchunk error in docs build (pydata#10545)
Call super().__init__() in st.SearchStrategy subclasses (pydata#10543)
CI: update actions location (pydata#10529)
meta: Fix labeler topic-documentation (pydata#10524)
drop_vars: use emit_user_level_warning (pydata#10528)
Pydap flaky tests (pydata#10525)
Remove test skip (pydata#10523)
Improve warning message and tests for timedelta decoding (pydata#10508)
Add dev whats-new (pydata#10522)
Add release notes for v2025.07.1 (pydata#10520)
Updates for Zarr 3 Dtypes (pydata#10456)
Update Custom Indexes section in api.rst (pydata#10517)
Expression not assigned (pydata#10507)
Raise if `Index.create_variables` returns more variables than passed in through `set_xindex` (pydata#10503)
Allow setting (or skipping) new indexes in open_dataset (pydata#8051)
doc: add Pandas(Multi)Index to api reference (pydata#10515)
Update pre-commit hooks (pydata#10510)
Update pre-commit ruff legacy alias (pydata#10511)
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@DimitriPapadopoulos@dcherian@max-sixty