Skip to content

Commit 88e2010

Browse files
committed
Better duplicate assumption
1 parent 316eb43 commit 88e2010

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xarray/tests/test_state_machine.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import hypothesis.extra.numpy as npst
44
import hypothesis.strategies as st
55
import numpy as np
6-
from hypothesis import note, settings
6+
from hypothesis import assume, note, settings
77
from hypothesis.stateful import RuleBasedStateMachine, invariant, precondition, rule
88

99
import xarray.testing.strategies as xrst
@@ -97,7 +97,8 @@ def unstack(self):
9797
choices = get_multiindex_dims(self.dataset)
9898
if choices:
9999
dim = random.choice(choices)
100-
self.dataset = self.dataset.drop_duplicates(dim).unstack(dim)
100+
assume(self.dataset.xindexes[dim].index.is_unique)
101+
self.dataset = self.dataset.unstack(dim)
101102
else:
102103
self.dataset = self.dataset.unstack()
103104

0 commit comments

Comments
 (0)