Skip to content
forked from pydata/xarray

Commit

Permalink
Better duplicate assumption
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Mar 15, 2024
1 parent 316eb43 commit 88e2010
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xarray/tests/test_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import hypothesis.extra.numpy as npst
import hypothesis.strategies as st
import numpy as np
from hypothesis import note, settings
from hypothesis import assume, note, settings
from hypothesis.stateful import RuleBasedStateMachine, invariant, precondition, rule

import xarray.testing.strategies as xrst
Expand Down Expand Up @@ -97,7 +97,8 @@ def unstack(self):
choices = get_multiindex_dims(self.dataset)
if choices:
dim = random.choice(choices)
self.dataset = self.dataset.drop_duplicates(dim).unstack(dim)
assume(self.dataset.xindexes[dim].index.is_unique)
self.dataset = self.dataset.unstack(dim)
else:
self.dataset = self.dataset.unstack()

Expand Down

0 comments on commit 88e2010

Please sign in to comment.