Skip to content

Commit e33563a

Browse files
author
MarcoGorelli
committed
fixup test_impl
1 parent dc6c60b commit e33563a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/tests/interchange/test_impl.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from pandas._libs.tslibs import iNaT
88
import pandas.util._test_decorators as td
99

10+
from pandas.core.dtypes.common import is_float_dtype
11+
1012
import pandas as pd
1113
import pandas._testing as tm
1214
from pandas.core.interchange.column import PandasColumn
@@ -115,7 +117,12 @@ def test_missing_from_masked():
115117
null_idx = df.index[
116118
rng.choice(np.arange(len(df)), size=num_nulls, replace=False)
117119
]
118-
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
119126

120127
df2 = df.__dataframe__()
121128

0 commit comments

Comments
 (0)