-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Check map function works with StringDtype (#40823) #41723
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
Conversation
import pandas._testing as tm | ||
|
||
|
||
class TestMap: |
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.
we have extensive map tests here: pandas/tests/apply/test_series_apply.py
see if you can find something similar. you can use the fixture any_string_dtype
to parmeterize this over various kinds of strings.
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.
Ok moved. Should the fixture be used like this?
# parameter
test_series_map_stringdtype(any_string_dtype):
ser1 = Series(
# ...
# then set here for all Series
dtype=any_string_dtype,
)
dtype=pd.StringDtype(), | ||
) | ||
|
||
tm.assert_frame_equal(result, expected) |
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.
this is a series method, so test on that.
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.
Sure, updated the test.
Checking map function on two series of data type StringDType. Series data is arbitrary.
Using suggested test fixture any_string_dtype.
thanks @mdhsieh |
Checks map function output on 2 DataFrames with data type StringDtype.