Skip to content

Conversation

@ion-elgreco
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Simpler API that allows multiple renames instead of having to chain .with_column_renamed.

What changes are included in this PR?

  • adds a rename method which in Rust calls with_column_renamed. I can look into adding a native rename in datafusion rust eventually.
  • deprecates with_column_renamed

Are there any user-facing changes?

  • deprecates with_column_renamed

Comment on lines +183 to +184
def rename(self, mapping: dict[str, str]) -> DataFrame:
r"""Rename one or multiple columns by applying a new projection.
Copy link
Member

Choose a reason for hiding this comment

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

How about with_columns_renamed to be more clear what this is doing? I could imagine users confusing this changing a table's name, even though the dataframe doesn't have a name associated with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would argue rename is quite clear if you are acquainted with pandas and pola-rs API.

With columns renamed is quite verbose ^^

Copy link
Member

Choose a reason for hiding this comment

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

I'd like to hear other people's opinions. Also I don't recommend we stray too far from what the upstream DataFusion uses for naming conventions.

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