Skip to content

Commit 15d94f3

Browse files
committed
Use not equivalent instead of not equals check.
1 parent 8b1f364 commit 15d94f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xarray/coding/variables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from ..core import dtypes, duck_array_ops, indexing
1010
from ..core.pycompat import dask_array_type
11+
from ..core.utils import equivalent
1112
from ..core.variable import Variable
1213

1314

@@ -148,7 +149,7 @@ def encode(self, variable, name=None):
148149
fv = encoding.get('_FillValue')
149150
mv = encoding.get('missing_value')
150151

151-
if (fv is not None) and (mv is not None) and (fv != mv):
152+
if fv is not None and mv is not None and not equivalent(fv, mv):
152153
raise ValueError("Variable {!r} has multiple fill values {}. "
153154
"Cannot encode data. "
154155
.format(name, [fv, mv]))

0 commit comments

Comments
 (0)