SPRKPY1034
pyspark.sql.functions.desc
This issue code has been deprecated
Message: pyspark.sql.functions.desc has a workaround, see documentation for more info
Category: Warning
Description
This issue appears when the SMA detects a use of the pyspark.sql.functions.desc function, which has a workaround.
Scenarios
The pyspark.sql.functions.desc
function takes either a column object or the name of the column as a string as its parameter. Both scenarios are not supported by Snowpark so this EWI is generated.
Scenario 1
Input
Below is an example of a use of the pyspark.sql.functions.desc
function that takes a column object as parameter.
Output
The SMA adds the EWI SPRKPY1034
to the output code to let you know that the desc
function with a column object parameter is not directly supported by Snowpark, but it has a workaround.
Recommended fix
As a workaround, you can call the snowflake.snowpark.Column.desc function from the column parameter.
Scenario 2
Input
Below is an example of a use of the pyspark.sql.functions.desc
function that takes the name of the column as parameter.
Output
The SMA adds the EWI SPRKPY1034
to the output code to let you know that the desc
function with a column name parameter is not directly supported by Snowpark, but it has a workaround.
Recommended fix
As a workaround, you can convert the string parameter into a column object using the snowflake.snowpark.functions.col function and then call the snowflake.snowpark.Column.desc function.
Additional recommendations
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
Last updated