Skip to content

TST: Add tests string series min max #45505

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

Merged
merged 4 commits into from
Jan 23, 2022

Conversation

NumberPiOso
Copy link
Contributor

Add tests for max and min aggregation at string series

In line with #31746

def test_reductions_series_strings():
# GH#31746
ser = Series(["a", "b"], dtype="string")
assert ser.max() == "b"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use pytest.mark.parameterize over min/max and the expected result?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course!

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jan 20, 2022
@jreback jreback added the Strings String extension data type and string data label Jan 21, 2022
@jreback jreback added this to the 1.5 milestone Jan 21, 2022
list_str = ["a", "b"]
ser = Series(list_str, dtype="string")
res_operation_serie = getattr(ser, operation)()
func_builtin_python = __builtins__[operation]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm instead of this could you hardcore the expected (a or b) with the parameterize as well?

@jreback jreback merged commit 45257d1 into pandas-dev:main Jan 23, 2022
@jreback
Copy link
Contributor

jreback commented Jan 23, 2022

thanks @NumberPiOso

@NumberPiOso NumberPiOso deleted the bug-string-series-agg branch January 23, 2022 22:40
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Strings String extension data type and string data Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New string data type aggregations (min, max, sum) work for DataFrames but not Series
3 participants