diff --git a/saqc/core/core.py b/saqc/core/core.py index 1a1976fea27b6e9a4e503bf84ccd79b1a4b7a68e..6ae5e48c51b00e29c66bfcbdf6f948940ce55a93 100644 --- a/saqc/core/core.py +++ b/saqc/core/core.py @@ -12,7 +12,7 @@ import warnings from copy import copy as shallowcopy from copy import deepcopy from functools import partial -from typing import Any, Hashable, Iterable, MutableMapping, overload +from typing import Any, Hashable, Iterable, MutableMapping import numpy as np import pandas as pd @@ -32,7 +32,7 @@ from saqc.funcs import FunctionsMixin # warnings pd.set_option("mode.chained_assignment", "warn") -pd.options.mode.copy_on_write = False +pd.set_option("mode.copy_on_write", True) np.seterr(invalid="ignore") diff --git a/tests/core/test_flags.py b/tests/core/test_flags.py index cc8949bf620cdabb4da6aa5ef72f9552a35d379c..c9628d49cd7f333e9fc7527dd05db48ddaf0cffc 100644 --- a/tests/core/test_flags.py +++ b/tests/core/test_flags.py @@ -122,7 +122,7 @@ def test_copy(data: Union[pd.DataFrame, DictOfSeries, Dict[str, pd.Series]]): # the underling series data is the same for c in shallow.columns: - assert shallow._data[c].index is flags._data[c].index + assert shallow._data[c].index.equals(flags._data[c].index) # the underling series data was copied for c in deep.columns: diff --git a/tests/core/test_history.py b/tests/core/test_history.py index e8279f46237482d0d90c7d29bc00480c664015e1..cb3412c370f90046bf14a062176932ed0bee9984 100644 --- a/tests/core/test_history.py +++ b/tests/core/test_history.py @@ -143,7 +143,7 @@ def test_copy(data): assert is_equal(deep, shallow) # underling pandas data was only copied with deep=True - assert shallow.hist.index is hist.hist.index + assert shallow.hist.index.equals(hist.hist.index) assert deep.hist.index is not hist.hist.index