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

feat: add DataFrame|LazyFrame.cast method #1045

Closed
wants to merge 6 commits into from
Closed

Conversation

FBruzzesi
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below.

Additionally extends Expr|Series.cast with strict argument

@github-actions github-actions bot added the enhancement New feature or request label Sep 23, 2024
@FBruzzesi
Copy link
Member Author

Unrelated CI failure

@MarcoGorelli
Copy link
Member

thanks @FBruzzesi !

are we sure we need this? I think this can currently be accomplished with with_columns and Expr.cast, no? e.g.

df.with_columns(nw.all().cast(nw.String))

or

df.with_columns(nw.col(col).cast(dtype) for col, dtype in dtypes.items())

?

i'm just a little unsure about expanding the DataFrame / LazyFrame API when there's a simple Expr solution

@FBruzzesi
Copy link
Member Author

FBruzzesi commented Sep 27, 2024

i'm just a little unsure about expanding the DataFrame / LazyFrame API when there's a simple Expr solution

Fair enough!

Polars exposed it, it is a nice ergonomic shortcut I am reaching out for, but definitly there is an Expr workaround

@FBruzzesi
Copy link
Member Author

Closing as not planned for now

@FBruzzesi FBruzzesi closed this Dec 1, 2024
@MarcoGorelli
Copy link
Member

sure, thanks - we can always reconsider later

@FBruzzesi
Copy link
Member Author

Yep, agree! This PR has so many conflicts that even if we want to consider adding it, it would be just easier to write it from scratch.

I am trying to do some cleanup, especially before sprints 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants