Skip to content

Commit 1818c28

Browse files
authored
TST: Add Series.update ExtensionArray tests (#34030)
1 parent 4a267c6 commit 1818c28

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/tests/series/methods/test_update.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pytest
33

4-
from pandas import DataFrame, Series
4+
from pandas import CategoricalDtype, DataFrame, NaT, Series, Timestamp
55
import pandas._testing as tm
66

77

@@ -93,6 +93,16 @@ def test_update_from_non_series(self, series, other, expected):
9393
Series([None, False], dtype="boolean"),
9494
Series([True, False], dtype="boolean"),
9595
),
96+
(
97+
Series(["a", None], dtype=CategoricalDtype(categories=["a", "b"])),
98+
Series([None, "b"], dtype=CategoricalDtype(categories=["a", "b"])),
99+
Series(["a", "b"], dtype=CategoricalDtype(categories=["a", "b"])),
100+
),
101+
(
102+
Series([Timestamp(year=2020, month=1, day=1, tz="Europe/London"), NaT]),
103+
Series([NaT, Timestamp(year=2020, month=1, day=1, tz="Europe/London")]),
104+
Series([Timestamp(year=2020, month=1, day=1, tz="Europe/London")] * 2),
105+
),
96106
],
97107
)
98108
def test_update_extension_array_series(self, result, target, expected):

0 commit comments

Comments
 (0)