Skip to content

Commit

Permalink
Deactivate unsorted-validation in pandas<2.20 - changed behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Dec 14, 2024
1 parent 2afc24c commit 1702ffb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_feature_append_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,12 @@ def test_append_data_not_sorted(test_pd_df, inplace):
# assert that original object was not modified
assert len(df._data) == 4

# `data` is not sorted
assert list(obs.data.scenario.unique()) == ["scen_b", "scen_a"]
assert list(obs.data.year.unique()) == [2010, 2005]
assert not obs._data.index.is_monotonic_increasing
# `data` is not sorted, only applies to pandas >= 2.2
# TODO remove this if-statement when dropping support for pandas < 2.2
if pd.__version__ >= "2.2":
assert list(obs.data.scenario.unique()) == ["scen_b", "scen_a"]
assert list(obs.data.year.unique()) == [2010, 2005]
assert not obs._data.index.is_monotonic_increasing


def test_append_meta(test_df):
Expand Down

0 comments on commit 1702ffb

Please sign in to comment.