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/11/29 07:45:46 UTC

[GitHub] [spark] HyukjinKwon opened a new pull request, #38834: [MINOR][DOCS] Fix types and docstring in DataFrame.toDF

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


[GitHub] [spark] HyukjinKwon commented on pull request #38834: [MINOR][PYTHON][DOCS] Fix types and docstring in DataFrame.toDF

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on PR #38834:
URL: https://github.com/apache/spark/pull/38834#issuecomment-1330223524

   Merged to master.


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


[GitHub] [spark] amaliujia commented on pull request #38834: [MINOR][PYTHON][DOCS] Fix types and docstring in DataFrame.toDF

Posted by GitBox <gi...@apache.org>.
amaliujia commented on PR #38834:
URL: https://github.com/apache/spark/pull/38834#issuecomment-1330222089

   LGTM


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


[GitHub] [spark] HyukjinKwon closed pull request #38834: [MINOR][PYTHON][DOCS] Fix types and docstring in DataFrame.toDF

Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #38834: [MINOR][PYTHON][DOCS] Fix types and docstring in DataFrame.toDF
URL: https://github.com/apache/spark/pull/38834


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


[GitHub] [spark] zhengruifeng commented on pull request #38834: [MINOR][PYTHON][DOCS] Fix types and docstring in DataFrame.toDF

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #38834:
URL: https://github.com/apache/spark/pull/38834#issuecomment-1330223964

   late lgtm, thanks


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