Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into string_array_numpy_…
…semantics

# Conflicts:
#	pandas/tests/arrays/string_/test_string.py
#	pandas/tests/extension/test_string.py
  • Loading branch information
phofl committed Aug 21, 2023
commit 5b0d24cb5e51940b6125bb4b591a7210e512957c
16 changes: 8 additions & 8 deletions pandas/tests/arrays/string_/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def test_add(dtype):
tm.assert_series_equal(result, expected)


def test_add_2d(dtype, request):
if dtype.storage in ("pyarrow", "pyarrow_numpy"):
def test_add_2d(dtype, request, arrow_string_storage):
if dtype.storage in arrow_string_storage:
reason = "Failed: DID NOT RAISE <class 'ValueError'>"
mark = pytest.mark.xfail(raises=None, reason=reason)
request.node.add_marker(mark)
Expand Down Expand Up @@ -153,8 +153,8 @@ def test_add_sequence(dtype):
tm.assert_extension_array_equal(result, expected)


def test_mul(dtype, request):
if dtype.storage in ("pyarrow", "pyarrow_numpy"):
def test_mul(dtype, request, arrow_string_storage):
if dtype.storage in arrow_string_storage:
reason = "unsupported operand type(s) for *: 'ArrowStringArray' and 'int'"
mark = pytest.mark.xfail(raises=NotImplementedError, reason=reason)
request.node.add_marker(mark)
Expand Down Expand Up @@ -412,8 +412,8 @@ def test_min_max(method, skipna, dtype, request):

@pytest.mark.parametrize("method", ["min", "max"])
@pytest.mark.parametrize("box", [pd.Series, pd.array])
def test_min_max_numpy(method, box, dtype, request):
if dtype.storage in ("pyarrow", "pyarrow_numpy") and box is pd.array:
def test_min_max_numpy(method, box, dtype, request, arrow_string_storage):
if dtype.storage in arrow_string_storage and box is pd.array:
if box is pd.array:
reason = "'<=' not supported between instances of 'str' and 'NoneType'"
else:
Expand All @@ -440,7 +440,7 @@ def test_fillna_args(dtype, request, arrow_string_storage):
expected = pd.array(["a", "b"], dtype=dtype)
tm.assert_extension_array_equal(res, expected)

if dtype.storage in ("pyarrow", "pyarrow_numpy"):
if dtype.storage in arrow_string_storage:
msg = "Invalid value '1' for dtype string"
else:
msg = "Cannot set non-string value '1' into a StringArray."
Expand Down Expand Up @@ -553,7 +553,7 @@ def test_use_inf_as_na(values, expected, dtype):
def test_memory_usage(dtype, arrow_string_storage):
# GH 33963

if dtype.storage in ("pyarrow", "pyarrow_numpy"):
if dtype.storage in arrow_string_storage:
pytest.skip(f"not applicable for {dtype.storage}")

series = pd.Series(["a", "b", "c"], dtype=dtype)
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/extension/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def test_is_not_string_type(self, dtype):


class TestInterface(base.BaseInterfaceTests):
def test_view(self, data, request):
if data.dtype.storage in ("pyarrow", "pyarrow_numpy"):
def test_view(self, data, request, arrow_string_storage):
if data.dtype.storage in arrow_string_storage:
pytest.skip(reason="2D support not implemented for ArrowStringArray")
super().test_view(data)

Expand All @@ -116,8 +116,8 @@ def test_from_dtype(self, data):


class TestReshaping(base.BaseReshapingTests):
def test_transpose(self, data, request):
if data.dtype.storage in ("pyarrow", "pyarrow_numpy"):
def test_transpose(self, data, request, arrow_string_storage):
if data.dtype.storage in arrow_string_storage:
pytest.skip(reason="2D support not implemented for ArrowStringArray")
super().test_transpose(data)

Expand All @@ -127,8 +127,8 @@ class TestGetitem(base.BaseGetitemTests):


class TestSetitem(base.BaseSetitemTests):
def test_setitem_preserves_views(self, data, request):
if data.dtype.storage in ("pyarrow", "pyarrow_numpy"):
def test_setitem_preserves_views(self, data, request, arrow_string_storage):
if data.dtype.storage in arrow_string_storage:
pytest.skip(reason="2D support not implemented for ArrowStringArray")
super().test_setitem_preserves_views(data)

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.