Skip to content

TST (string dtype): follow-up on GH-59329 fixing new xfails #59352

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

Conversation

jorisvandenbossche
Copy link
Member

Follow-up on #59329, which caused some failures on main after being merged (see #59329 (comment))

xref #54792

@jorisvandenbossche jorisvandenbossche added Testing pandas testing functions or related to the test suite Strings String extension data type and string data labels Jul 30, 2024
Comment on lines +583 to +586
elif isinstance(left, StringDtype):
# TODO(infer_string) this special case could be avoided if we have
# a more informative repr https://github.com/pandas-dev/pandas/issues/59342
left = f"StringDtype(storage={left.storage}, na_value={left.na_value})"
Copy link
Member Author

Choose a reason for hiding this comment

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

See #58451 (comment) for some discussion, but in short I am adding this for now because right now you can get test failures (like the ones that this PR is silencing with xfails) that have a very hard assert message like:

AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="col1") are different

Attribute "dtype" are different
[left]:  string[pyarrow]
[right]: string[pyarrow]

which is not very helpful ...

The reason for that is because I did not bake the pd.NA vs np.nan information in the string alias / representation.

We need to resolve that issue more in general (see the linked issue in the comment above), but short term this ensures that at least for developing and running tests, we can distinguish easily between the different dtypes.

@jorisvandenbossche
Copy link
Member Author

The build (for future strings) is green again. I think it would be good to merge this rather quickly given it's fixing failures on main (will do in a few hours if no-one beats me to it).

@mroeschke mroeschke merged commit dd2dbcd into pandas-dev:main Jul 30, 2024
39 of 45 checks passed
@mroeschke
Copy link
Member

Thanks @jorisvandenbossche

@jorisvandenbossche jorisvandenbossche deleted the string-dtype-tests-fixup branch July 30, 2024 20:40
WillAyd pushed a commit that referenced this pull request Aug 13, 2024
* TST (string dtype): follow-up on GH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 14, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 15, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 15, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 15, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Aug 20, 2024
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 21, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 27, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Sep 20, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
jorisvandenbossche added a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
jorisvandenbossche added a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
jorisvandenbossche added a commit to WillAyd/pandas that referenced this pull request Oct 3, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
jorisvandenbossche added a commit to WillAyd/pandas that referenced this pull request Oct 7, 2024
…pandas-dev#59352)

* TST (string dtype): follow-up on pandas-devGH-59329 fixing new xfails

* add missing strict
jorisvandenbossche added a commit that referenced this pull request Oct 9, 2024
* TST (string dtype): follow-up on GH-59329 fixing new xfails

* add missing strict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported 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