We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc6c60b commit e33563aCopy full SHA for e33563a
pandas/tests/interchange/test_impl.py
@@ -7,6 +7,8 @@
7
from pandas._libs.tslibs import iNaT
8
import pandas.util._test_decorators as td
9
10
+from pandas.core.dtypes.common import is_float_dtype
11
+
12
import pandas as pd
13
import pandas._testing as tm
14
from pandas.core.interchange.column import PandasColumn
@@ -115,7 +117,12 @@ def test_missing_from_masked():
115
117
null_idx = df.index[
116
118
rng.choice(np.arange(len(df)), size=num_nulls, replace=False)
119
]
- df.loc[null_idx, col] = None
120
+ if is_float_dtype(df[col]):
121
+ warn = None
122
+ else:
123
+ warn = FutureWarning
124
+ with tm.assert_produces_warning(warn, match="item of incompatible dtype"):
125
+ df.loc[null_idx, col] = None
126
127
df2 = df.__dataframe__()
128
0 commit comments