Skip to content

BUG: #49889 #50098

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

ronwho
Copy link

@ronwho ronwho commented Dec 7, 2022

Fix for issue: BUG: categorical_column_to_series() should not accept only PandasColumn #49889

Relaxed assert statement from PandasColumn to Column as not only Pandas column could be used here

@@ -182,7 +182,7 @@ def categorical_column_to_series(col: Column) -> tuple[pd.Series, Any]:

cat_column = categorical["categories"]
# for mypy/pyright
assert isinstance(cat_column, PandasColumn), "categories must be a PandasColumn"
assert isinstance(cat_column, Column), "categories must abide by __dataframe__ protocol API"
Copy link
Member

Choose a reason for hiding this comment

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

linter is failing here bc line is too long. try running black

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

Can you add a test?

@AlenkaF
Copy link

AlenkaF commented Jan 4, 2023

I think the check for a dataframe interchange protocol Column class should be removed altogether. If needed there could, instead, be a check for a presence of the Column class attributes? Otherwise the roundtrip tests with other libraries implementing the protocol should always fail.

@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants