Skip to content

[ArrowStringArray] TST: parametrize str.extract tests #41393

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
May 12, 2021

Conversation

simonjayhawkins
Copy link
Member

No description provided.

@simonjayhawkins simonjayhawkins added Testing pandas testing functions or related to the test suite Strings String extension data type and string data labels May 9, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 9, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm, some suggestions for followons.


# two normal groups, one non-capturing group
result = Series(["A11", "B22", "C33"]).str.extract(
"([AB])([123])(?:[123])", expand=False
s = Series(["A11", "B22", "C33"], dtype=any_string_dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to break up really long tests like this (followon), unless easy to view in the same one


@pytest.mark.parametrize(
"index",
[
tm.makeStringIndex,
tm.makeUnicodeIndex,
tm.makeIntIndex,
tm.makeDateIndex,
tm.makePeriodIndex,
tm.makeRangeIndex,
Copy link
Contributor

Choose a reason for hiding this comment

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

in followon if can use the existing fixtures

s_or_idx.str.extract("(?:[AB]).*", expand=True)


@pytest.mark.parametrize("klass", [Series, Index])
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we have a parameterization for this (followon)

@jreback
Copy link
Contributor

jreback commented May 10, 2021

cc @jorisvandenbossche if any comments (though prob easier to comment and handle in followon)

@jreback jreback merged commit 01cd87f into pandas-dev:master May 12, 2021
@jreback
Copy link
Contributor

jreback commented May 12, 2021

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the extract-tests branch May 12, 2021 08:03
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
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.

2 participants