Hyukjin Kwon created SPARK-46063:
------------------------------------

             Summary: Improve error messages related to argument types in cute, 
rollup, and pivot
                 Key: SPARK-46063
                 URL: https://issues.apache.org/jira/browse/SPARK-46063
             Project: Spark
          Issue Type: Improvement
          Components: Connect, PySpark
    Affects Versions: 4.0.0
            Reporter: Hyukjin Kwon


{code}
>>> spark.range(1).cube(cols=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.
{code}

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

    .. versionadded:: 1.4.0

    .. versionchanged:: 3.4.0
```

it has to be {cols}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to