SPRKPY1033

pyspark.sql.functions.asc has a workaround

Category

Warning.

Description

This issue appears when the tool detects the usage of pyspark.sql.functions.asc which has a workaround.

Note: This workaround is deprecated because a later tool version supports the asc snowflake function as direct.

Input code:

df.orderBy(asc(col))
df.orderBy(asc("colName"))

Output code:

#EWI: SPRKPY1033 => pyspark.sql.functions.asc has a workaround, see documentation for more info
df.orderBy(asc(col))
#EWI: SPRKPY1033 => pyspark.sql.functions.asc has a workaround, see documentation for more info
df.orderBy(asc("colName"))

Scenarios

This function has two overloads:

1. asc(col: Column)

Action: use instead com.snowflake.snowpark.Column.asc function, by applying it to the column parameter. Example:

df.orderBy(col.asc())

2. asc(colName: str)

Action: use instead com.snowflake.snowpark.Column.asc function, by converting the parameter string into a column (by using col function) and then applying asc to it. Example:

df.orderBy(col("colName").asc())

Recommendation

  • For more support, you can email us at snowconvert-info@snowflake.com. If you have a contract for support with Snowflake, reach out to your sales engineer and they can direct your support needs.