Skip to content

Expression not assigned #10507

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

Merged
merged 3 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions xarray/coding/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,8 @@
Issue SerializationWarning if appropriate.
"""
raw_fill_dict = {}
[
for attr in ("missing_value", "_FillValue"):
pop_to(attrs, raw_fill_dict, attr, name=name)
for attr in ("missing_value", "_FillValue")
]
encoded_fill_values = set()
for k in list(raw_fill_dict):
v = raw_fill_dict[k]
Expand Down Expand Up @@ -241,7 +239,7 @@
# otherwise numpy unsigned ints will silently cast to the signed counterpart
fill_value = fill_value.item()
# passes if provided fill value fits in encoded on-disk type
new_fill = encoded_dtype.type(fill_value)

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 bare-min-and-scipy

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).

Check warning on line 242 in xarray/coding/variables.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11 min-all-deps

NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 255 to int8 will fail in the future. For the old behavior, usually: np.array(value).astype(dtype) will give the desired result (the cast overflows).
except OverflowError:
encoded_kind_str = "signed" if encoded_dtype.kind == "i" else "unsigned"
warnings.warn(
Expand Down Expand Up @@ -376,11 +374,9 @@

dims, data, attrs, encoding = unpack_for_decoding(variable)

# Even if _Unsigned is use, retain on-disk _FillValue
[
# Even if _Unsigned is used, retain on-disk _FillValue
for attr, value in raw_fill_dict.items():
safe_setitem(encoding, attr, value, name=name)
for attr, value in raw_fill_dict.items()
]

if "_Unsigned" in attrs:
unsigned = pop_to(attrs, encoding, "_Unsigned")
Expand Down
3 changes: 2 additions & 1 deletion xarray/tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,8 @@ def test_unify_chunks(map_ds):
def test_unify_chunks_shallow_copy(obj, transform):
obj = transform(obj)
unified = obj.unify_chunks()
assert_identical(obj, unified) and obj is not obj.unify_chunks()
assert_identical(obj, unified)
# assert obj is not unified


@pytest.mark.parametrize("obj", [make_da()])
Expand Down
Loading