|
108 | 108 | PeriodArray,
|
109 | 109 | TimedeltaArray,
|
110 | 110 | )
|
| 111 | +from pandas.core.arrays.string_ import StringDtype |
111 | 112 | from pandas.core.base import PandasObject
|
112 | 113 | import pandas.core.common as com
|
113 | 114 | from pandas.core.computation import expressions
|
@@ -1684,7 +1685,7 @@ def where(self, other, cond) -> list[Block]:
|
1684 | 1685 | res_values = arr._where(cond, other).T
|
1685 | 1686 | except (ValueError, TypeError):
|
1686 | 1687 | if self.ndim == 1 or self.shape[0] == 1:
|
1687 |
| - if isinstance(self.dtype, IntervalDtype): |
| 1688 | + if isinstance(self.dtype, (IntervalDtype, StringDtype)): |
1688 | 1689 | # TestSetitemFloatIntervalWithIntIntervalValues
|
1689 | 1690 | blk = self.coerce_to_target_dtype(orig_other, raise_on_upcast=False)
|
1690 | 1691 | return blk.where(orig_other, orig_cond)
|
@@ -1854,7 +1855,7 @@ def fillna(
|
1854 | 1855 | limit: int | None = None,
|
1855 | 1856 | inplace: bool = False,
|
1856 | 1857 | ) -> list[Block]:
|
1857 |
| - if isinstance(self.dtype, IntervalDtype): |
| 1858 | + if isinstance(self.dtype, (IntervalDtype, StringDtype)): |
1858 | 1859 | # Block.fillna handles coercion (test_fillna_interval)
|
1859 | 1860 | if limit is not None:
|
1860 | 1861 | raise ValueError("limit must be None")
|
|
0 commit comments