Skip to content

[ArrowStringArray] API: StringArray -> ObjectStringArray #40962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 33 additions & 20 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,22 +1120,30 @@ def string_dtype(request):

@pytest.fixture(
params=[
"string",
pytest.param(
"arrow_string", marks=td.skip_if_no("pyarrow", min_version="1.0.0")
),
"python",
pytest.param("pyarrow", marks=td.skip_if_no("pyarrow", min_version="1.0.0")),
]
)
def nullable_string_dtype(request):
def string_storage(request):
return request.param


# Aliases so we can test with cartesian product of string_storage
string_storage2 = string_storage
string_storage3 = string_storage


@pytest.fixture
def nullable_string_dtype(string_storage):
"""
Parametrized fixture for string dtypes.
Parametrized fixture for StringDtype with string_storage.

* 'string'
* 'arrow_string'
* 'string' (python storage)
* 'string` (pyarrow storage)
"""
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
with pd.option_context("string_storage", string_storage):

return request.param
yield "string"


@pytest.fixture(params=tm.BYTES_DTYPES)
Expand Down Expand Up @@ -1163,22 +1171,27 @@ def object_dtype(request):
@pytest.fixture(
params=[
"object",
"string",
pytest.param(
"arrow_string", marks=td.skip_if_no("pyarrow", min_version="1.0.0")
),
"python",
pytest.param("pyarrow", marks=td.skip_if_no("pyarrow", min_version="1.0.0")),
]
)
def any_string_dtype(request):
def any_string_dtype_param(request):
return request.param


@pytest.fixture
def any_string_dtype(any_string_dtype_param):
"""
Parametrized fixture for string dtypes.
* 'object'
* 'string'
* 'arrow_string'
* 'string' (python storage)
* 'string` (pyarrow storage)
"""
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401

return request.param
if any_string_dtype_param == "object":
yield "object"
else:
with pd.option_context("string_storage", any_string_dtype_param):
yield "string"


@pytest.fixture(params=tm.DATETIME64_DTYPES)
Expand Down
Loading