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

fix(python): Include pl. qualifier for inner dtypes in to_init_repr() #16223

Closed

Conversation

datenzauberai
Copy link
Contributor

This is a minimal fix for #15802 by adding a method that prefixes representations, which will be called "recursively" for nested types. Idea:

  • Series.to_init_repr will call the new method _prefixed_repr with the prefix="pl."
  • for normal DataTypes _prefixed_repr will use __repr__ and prefix it with the given prefix => no further changes necessary
  • for NestedTypes the flow of control is reversed __repr__ will call _prefixed_repr with no prefix. _prefixed_repr will take care of passing the prefix for the inner dtype representation

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels May 14, 2024
@datenzauberai datenzauberai marked this pull request as draft May 14, 2024 18:13
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I don't like the idea of adding this as a method on the class though as it's a pretty niche thing. I'd prefer it to exist as a utility function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants