Skip to content

ENH: allow EADtype to specify _supports_2d #54832

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 1 commit into from
Sep 1, 2023

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Aug 28, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

The can_fast_transpose bit isn't used but is future-proofing for a time when we have e.g. pyarrow tables backing a 2D EA where transposing isn't cheap. If asked, I'll revert that bit until it is necessary.

@mroeschke mroeschke added the ExtensionArray Extending pandas with custom dtypes or arrays. label Aug 29, 2023
# skip tests that are defined in Dim2CompatTests
test_func = node._obj
if test_func.__qualname__.startswith("Dim2CompatTests"):
# TODO: is there a less hacky way of checking this?
Copy link
Member

Choose a reason for hiding this comment

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

Could the tests in Dim2CompatTests just be skipped if data.dtype._supports_2d?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is skipping if not data.dtype.supports_2d. The acrobatics here are for test classes that subclass ExtensionTests, since we want this fixture to only apply to tests defined in Dim2CompatTests, not all tests in ExtensionTests

@mroeschke mroeschke added this to the 2.2 milestone Sep 1, 2023
@mroeschke mroeschke merged commit bb08817 into pandas-dev:main Sep 1, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the enh-supports-2d-2 branch September 1, 2023 01:18
mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants