Skip to content

Commit fb67871

Browse files
committed
write test
1 parent c3156ec commit fb67871

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_frame.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,16 @@ def test_slice_setitem() -> None:
290290

291291
def test_types_setitem() -> None:
292292
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4], 5: [6, 7]})
293+
h = cast(Hashable, "col1")
293294
i = pd.Index(["col1", "col2"])
294295
s = pd.Series(["col1", "col2"])
295296
a = np.array(["col1", "col2"])
296297
df["col1"] = [1, 2]
297-
df[5] = [5, 6]
298+
df[h] = [5, 6]
299+
df[iter([h])] = [[5], [6]]
300+
df.loc[:, h] = [5, 6]
301+
df.loc[:, UserList([h])] = [[5], [6]]
302+
df.loc[:, iter([h])] = [[5], [6]]
298303
df[["col1", "col2"]] = [[1, 2], [3, 4]]
299304
df[s] = [5, 6]
300305
df.loc[:, s] = [5, 6]

0 commit comments

Comments
 (0)