You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/07 12:03:34 UTC
[GitHub] [spark] Yikun commented on a change in pull request #32431: [SPARK-35173][SQL][PYTHON] Add multiple columns adding support
Yikun commented on a change in pull request #32431:
URL: https://github.com/apache/spark/pull/32431#discussion_r800587645
##########
File path: python/pyspark/sql/dataframe.py
##########
@@ -2911,6 +2911,37 @@ def freqItems(
support = 0.01
return DataFrame(self._jdf.stat().freqItems(_to_seq(self._sc, cols), support), self.sql_ctx)
+ def withColumns(self, colsMap: Dict[str, Column]) -> "DataFrame":
Review comment:
Yep, that means for now, we only allow:
```python
withColumns({"col1": col1, "col2": col2})
```
in future, we can also enable kwargs to allow:
```python
# With args and kwargs
withColumns({"col1": col1, "col2": col2}, col3=col3)
# With only kwargs
withColumns(col4=col4)
```
If no objection, I will update to *colsMap in this PR.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org