Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-46063

Improve error messages related to argument types in cute, rollup, groupby, and pivot

    XMLWordPrintableJSON

Details

    Description

      >>> 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.
      
      >>> 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.
      
          .. versionadded:: 1.4.0
      
          .. versionchanged:: 3.4.0
      

      it has to be

      {cols}

      Attachments

        Issue Links

          Activity

            People

              gurwls223 Hyukjin Kwon
              gurwls223 Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: