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 cast to DataFrame #916

Merged
merged 4 commits into from
Oct 21, 2024
Merged

Conversation

ion-elgreco
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

A top level cast is very practical and a common practice to do, since it's just a projection of columns, we call with_columns underneath. Therefore it builds on top of: #909, so that one needs to be merged first.

What changes are included in this PR?

  • adds a cast method which takes in a mapping of col_names and dtypes.

Important: I am going to work soon on creating a datafusion-python native schema struct and classes. Because going to pyarrow is simply to painful :) and then we can also drop the pyarrow dependency for that part

Are there any user-facing changes?

  • adds new method.

Copy link
Contributor

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

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

Very nice addition, but it looks like this branch is on top of your other one since it uses with_columns so we will need to merge that one before this.

python/datafusion/dataframe.py Outdated Show resolved Hide resolved
python/datafusion/dataframe.py Outdated Show resolved Hide resolved
@ion-elgreco
Copy link
Contributor Author

Very nice addition, but it looks like this branch is on top of your other one since it uses with_columns so we will need to merge that one before this.

Yess, we need to merge in that order

@ion-elgreco ion-elgreco requested a review from timsaucer October 13, 2024 15:03
@timsaucer timsaucer merged commit 70c099a into apache:main Oct 21, 2024
15 checks passed
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.

2 participants