ion-elgreco commented on code in PR #908:
URL: https://github.com/apache/datafusion-python/pull/908#discussion_r1798339065
##########
python/datafusion/dataframe.py:
##########
@@ -175,7 +178,23 @@ def with_column_renamed(self, old_name: str, new_name:
str) -> DataFrame:
Returns:
DataFrame with the column renamed.
"""
- return DataFrame(self.df.with_column_renamed(old_name, new_name))
+ return DataFrame(self.df.rename({old_name: new_name}))
+
+ def rename(self, mapping: dict[str, str]) -> DataFrame:
+ r"""Rename one or multiple columns by applying a new projection.
Review Comment:
I would argue `rename` is quite clear if you are acquainted with pandas and
pola-rs API.
With columns renamed is quite verbose ^^
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]