Skip to content
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

Use enum in ArraySchema for to-be-written Pandas category #1881

Merged

Conversation

nguyenv
Copy link
Collaborator

@nguyenv nguyenv commented Dec 15, 2023

Fixes issue #1879 for Python

As reported by @atolopko-czi

Copy link

@nguyenv nguyenv marked this pull request as ready for review December 15, 2023 15:10
@nguyenv nguyenv requested review from ihnorton and johnkerl December 15, 2023 15:14
Copy link
Contributor

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

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

🚢

attr = A.schema.attr(j)
if attr.enum_label is not None:
enmr = A.enum(attr.enum_label).values()
df[attr.name] = df[attr.name].cat.set_categories(enmr)
Copy link
Member

Choose a reason for hiding this comment

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

We should probably do this at the arrow level eventually, this is going to be expensive. (sc-38461)

@ihnorton ihnorton merged commit a93be0c into dev Dec 15, 2023
32 of 33 checks passed
@ihnorton ihnorton deleted the viviannguyen/sc-38408/enumeration-attribute-incorrectly-writes branch December 15, 2023 20:59
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.

3 participants