You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/11/23 04:39:19 UTC

[PR] [SPARK-46063][PYTHON][CONNECT] Improve error messages related to argument types in cute, rollup, groupby, and pivot [spark]

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

   ### What changes were proposed in this pull request?
   
   This PR  improves error messages related to argument types in `cute`, `rollup`, `groupBy`, and `pivot`.
   
   ```bash
   ./bin/pyspark --remote local
   ```
   
   ```python
   >>> help(spark.range(1).cube)
   Help on method cube in module pyspark.sql.connect.dataframe:
   
   cube(*cols: 'ColumnOrName') -> 'GroupedData' method of pyspark.sql.connect.dataframe.DataFrame instance
       Create a multi-dimensional cube for the current :class:`DataFrame` using
       the specified columns, allowing aggregations to be performed on them.
   ...
   ```
   
   **Before:**
   
   ```python
   >>> spark.range(1).cube(1.2)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/.../python/pyspark/sql/connect/dataframe.py", line 544, in cube
       raise PySparkTypeError(
   pyspark.errors.exceptions.base.PySparkTypeError: [NOT_COLUMN_OR_STR] Argument `cube` should be a Column or str, got float.
   ```
   
   
   **After:**
   
   ```
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/.../python/pyspark/sql/connect/dataframe.py", line 544, in cube
       raise PySparkTypeError(
   pyspark.errors.exceptions.base.PySparkTypeError: [NOT_COLUMN_OR_STR] Argument `cols` should be a Column or str, got float.
   ```
   
   
   ### Why are the changes needed?
   
   For better error messages to end users.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it fixes the user-facing error message.
   
   ### How was this patch tested?
   
   Manually tested.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.
   


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


Re: [PR] [SPARK-46063][PYTHON][CONNECT] Improve error messages related to argument types in cute, rollup, groupby, and pivot [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #43968: [SPARK-46063][PYTHON][CONNECT] Improve error messages related to argument types in cute, rollup, groupby, and pivot
URL: https://github.com/apache/spark/pull/43968


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


Re: [PR] [SPARK-46063][PYTHON][CONNECT] Improve error messages related to argument types in cute, rollup, groupby, and pivot [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #43968:
URL: https://github.com/apache/spark/pull/43968#issuecomment-1823813111

   cc @zhengruifeng 


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


Re: [PR] [SPARK-46063][PYTHON][CONNECT] Improve error messages related to argument types in cute, rollup, groupby, and pivot [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #43968:
URL: https://github.com/apache/spark/pull/43968#issuecomment-1823920094

   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