Skip to content

Commit 2715690

Browse files
remove overlap with pandas-dev#40679
1 parent d02379d commit 2715690

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

pandas/tests/dtypes/test_common.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,7 @@ def test_is_string_dtype():
281281
assert com.is_string_dtype(object)
282282
assert com.is_string_dtype(np.array(["a", "b"]))
283283
assert com.is_string_dtype(pd.StringDtype())
284-
285-
286-
def test_is_string_dtype_nullable(nullable_string_dtype):
287-
assert com.is_string_dtype(pd.array(["a", "b"], dtype=nullable_string_dtype))
284+
assert com.is_string_dtype(pd.array(["a", "b"], dtype="string"))
288285

289286

290287
integer_dtypes: List = []

pandas/tests/extension/json/array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
ExtensionDtype,
4040
)
4141
from pandas.api.types import is_bool_dtype
42-
from pandas.core.arrays.string_arrow import ArrowStringDtype
4342

4443

4544
class JSONDtype(ExtensionDtype):
@@ -195,7 +194,7 @@ def astype(self, dtype, copy=True):
195194
if copy:
196195
return self.copy()
197196
return self
198-
elif isinstance(dtype, (StringDtype, ArrowStringDtype)):
197+
elif isinstance(dtype, StringDtype):
199198
value = self.astype(str) # numpy doesn'y like nested dicts
200199
return dtype.construct_array_type()._from_sequence(value, copy=False)
201200

pandas/tests/frame/methods/test_combine_first.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,15 @@ def test_combine_first_with_asymmetric_other(self, val):
381381

382382
tm.assert_frame_equal(res, exp)
383383

384-
def test_combine_first_string_dtype_only_na(self, nullable_string_dtype):
384+
def test_combine_first_string_dtype_only_na(self):
385385
# GH: 37519
386-
df = DataFrame(
387-
{"a": ["962", "85"], "b": [pd.NA] * 2}, dtype=nullable_string_dtype
388-
)
389-
df2 = DataFrame({"a": ["85"], "b": [pd.NA]}, dtype=nullable_string_dtype)
386+
df = DataFrame({"a": ["962", "85"], "b": [pd.NA] * 2}, dtype="string")
387+
df2 = DataFrame({"a": ["85"], "b": [pd.NA]}, dtype="string")
390388
df.set_index(["a", "b"], inplace=True)
391389
df2.set_index(["a", "b"], inplace=True)
392390
result = df.combine_first(df2)
393391
expected = DataFrame(
394-
{"a": ["962", "85"], "b": [pd.NA] * 2}, dtype=nullable_string_dtype
392+
{"a": ["962", "85"], "b": [pd.NA] * 2}, dtype="string"
395393
).set_index(["a", "b"])
396394
tm.assert_frame_equal(result, expected)
397395

pandas/tests/frame/test_constructors.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1654,10 +1654,10 @@ def test_constructor_empty_with_string_dtype(self):
16541654
df = DataFrame(index=[0, 1], columns=[0, 1], dtype="U5")
16551655
tm.assert_frame_equal(df, expected)
16561656

1657-
def test_constructor_empty_with_string_extension(self, nullable_string_dtype):
1657+
def test_constructor_empty_with_string_extension(self):
16581658
# GH 34915
1659-
expected = DataFrame(index=[], columns=["c1"], dtype=nullable_string_dtype)
1660-
df = DataFrame(columns=["c1"], dtype=nullable_string_dtype)
1659+
expected = DataFrame(index=[], columns=["c1"], dtype="string")
1660+
df = DataFrame(columns=["c1"], dtype="string")
16611661
tm.assert_frame_equal(df, expected)
16621662

16631663
def test_constructor_single_value(self):

pandas/tests/tools/test_to_numeric.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,9 @@ def test_precision_float_conversion(strrep):
725725
(["1", "2", "3.5"], Series([1, 2, 3.5])),
726726
],
727727
)
728-
def test_to_numeric_from_nullable_string(values, nullable_string_dtype, expected):
728+
def test_to_numeric_from_nullable_string(values, expected):
729729
# https://github.com/pandas-dev/pandas/issues/37262
730-
s = Series(values, dtype=nullable_string_dtype)
730+
s = Series(values, dtype="string")
731731
result = to_numeric(s)
732732
tm.assert_series_equal(result, expected)
733733

0 commit comments

Comments
 (0)