Skip to content

Commit ac4ab7e

Browse files
Expression not assigned
1 parent a8de733 commit ac4ab7e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

xarray/coding/variables.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ def _check_fill_values(attrs, name, dtype):
164164
Issue SerializationWarning if appropriate.
165165
"""
166166
raw_fill_dict = {}
167-
[
167+
for attr in ("missing_value", "_FillValue"):
168168
pop_to(attrs, raw_fill_dict, attr, name=name)
169-
for attr in ("missing_value", "_FillValue")
170-
]
171169
encoded_fill_values = set()
172170
for k in list(raw_fill_dict):
173171
v = raw_fill_dict[k]
@@ -376,11 +374,9 @@ def decode(self, variable: Variable, name: T_Name = None):
376374

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

379-
# Even if _Unsigned is use, retain on-disk _FillValue
380-
[
377+
# Even if _Unsigned is used, retain on-disk _FillValue
378+
for attr, value in raw_fill_dict.items():
381379
safe_setitem(encoding, attr, value, name=name)
382-
for attr, value in raw_fill_dict.items()
383-
]
384380

385381
if "_Unsigned" in attrs:
386382
unsigned = pop_to(attrs, encoding, "_Unsigned")

xarray/tests/test_dask.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,8 @@ def test_unify_chunks(map_ds):
11291129
def test_unify_chunks_shallow_copy(obj, transform):
11301130
obj = transform(obj)
11311131
unified = obj.unify_chunks()
1132-
assert_identical(obj, unified) and obj is not obj.unify_chunks()
1132+
assert_identical(obj, unified)
1133+
assert obj is not unified
11331134

11341135

11351136
@pytest.mark.parametrize("obj", [make_da()])

0 commit comments

Comments
 (0)