Skip to content

Commit

Permalink
Merge pull request #224 from PowerGridModel/fix/retro-fit-pandas-2-1-0
Browse files Browse the repository at this point in the history
do not fatally crash on pandas 2.1
  • Loading branch information
Jerry-Jinfeng-Guo authored Feb 7, 2024
2 parents ea1eeb4 + bca0511 commit 4358e5f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@

import pandas as pd

pd.set_option("future.no_silent_downcasting", True)
try:
pd.set_option("future.no_silent_downcasting", True)
except pd.errors.OptionError:
pass
7 changes: 5 additions & 2 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@

import pandas as pd

# TODO(mgovers) We're ready for Pandas 3.x, but pandapower is not. Move to parent conftest when it is.
pd.set_option("mode.copy_on_write", True)
try:
# TODO(mgovers) We're ready for Pandas 3.x, but pandapower is not. Move to parent conftest when it is.
pd.set_option("mode.copy_on_write", True)
except pd.errors.OptionError:
pass
12 changes: 9 additions & 3 deletions tests/validation/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

import pandas as pd

pd.set_option("future.no_silent_downcasting", True)
try:
pd.set_option("future.no_silent_downcasting", True)
except pd.errors.OptionError:
pass

# TODO(mgovers) We're ready for Pandas 3.x, but pandapower is not. Move to parent conftest when it is.
pd.set_option("mode.copy_on_write", False)
try:
# TODO(mgovers) We're ready for Pandas 3.x, but pandapower is not. Move to parent conftest when it is.
pd.set_option("mode.copy_on_write", False)
except pd.errors.OptionError:
pass

0 comments on commit 4358e5f

Please sign in to comment.