-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: [ArrowStringArray] more parameterised testing - part 3 #40755
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -812,11 +812,15 @@ def test_write_with_schema(self, pa): | |
def test_additional_extension_arrays(self, pa): | ||
# test additional ExtensionArrays that are supported through the | ||
# __arrow_array__ protocol | ||
|
||
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401 | ||
|
||
df = pd.DataFrame( | ||
{ | ||
"a": pd.Series([1, 2, 3], dtype="Int64"), | ||
"b": pd.Series([1, 2, 3], dtype="UInt32"), | ||
"c": pd.Series(["a", None, "c"], dtype="string"), | ||
"d": pd.Series(["a", None, "c"], dtype="arrow_string"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this test is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this test has a minimum of 0.15. I would make a separate, dedicated test for ArrowStringArray |
||
} | ||
) | ||
if LooseVersion(pyarrow.__version__) >= LooseVersion("0.16.0"): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,9 +254,9 @@ def test_replace2(self): | |
assert (ser[6:10] == -1).all() | ||
assert (ser[20:30] == -1).all() | ||
|
||
def test_replace_with_dictlike_and_string_dtype(self): | ||
def test_replace_with_dictlike_and_string_dtype(self, nullable_string_dtype): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is this correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say that's a bug, but that's in any case unrelated for this PR (there are a few open issues related to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See eg #40732 (for other nullable dtypes) |
||
# GH 32621 | ||
s = pd.Series(["one", "two", np.nan], dtype="string") | ||
s = pd.Series(["one", "two", np.nan], dtype=nullable_string_dtype) | ||
expected = pd.Series(["1", "2", np.nan]) | ||
result = s.replace({"one": "1", "two": "2"}) | ||
tm.assert_series_equal(expected, result) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force registration of "arrow_string", not strictly necessary but won't be missed as
ArrowStringDtype
will be removed.