HyukjinKwon opened a new pull request, #38834:
URL: https://github.com/apache/spark/pull/38834

   ### What changes were proposed in this pull request?
   
   `df.toDF` cannot take `Column`s:
   
   ```python
   >>> df.toDF(df.id)
   ```
   ```
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/.../spark/python/pyspark/sql/dataframe.py", line 4606, in toDF
       jdf = self._jdf.toDF(self._jseq(cols))
     File "/.../spark/python/pyspark/sql/dataframe.py", line 2413, in _jseq
       return _to_seq(self.sparkSession._sc, cols, converter)
     File "/.../spark/python/pyspark/sql/column.py", line 88, in _to_seq
       return sc._jvm.PythonUtils.toSeq(cols)
     File "/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", 
line 1314, in __call__
     File "/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", 
line 1277, in _build_args
     File "/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", 
line 1264, in _get_args
     File 
"/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_collections.py", line 
511, in convert
     File "/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", 
line 1314, in __call__
     File "/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", 
line 1277, in _build_args
     File 
"/.../forked/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", line 
1264, in _get_args
     File 
"/.../spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_collections.py", line 
510, in convert
     File "/.../spark/python/pyspark/sql/column.py", line 622, in __iter__
       raise TypeError("Column is not iterable")
   TypeError: Column is not iterable
   ```
   
   This PR fixes the type and docstrings to remove the mention about `Column`
   
   ### Why are the changes needed?
   
   To provide the correct documentation to the end users.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No for the main codes.
   Yes for the docs.
   
   ### How was this patch tested?
   
   CI in this PR should verify it via Python linters.
   


-- 
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]

Reply via email to