SPRKPY1036

pyspark.sql.column.Column.getField has a workaround

Description

This issue appears when the tool detects the usage of pyspark.sql.column.Column.getField which has a workaround. Note: This workaround is deprecated because a later tool version supports the getField function as direct.

Input code:

myColumn.getField("fieldName")

Output code:

#EWI: SPRKPY1036 => pyspark.sql.column.Column.getField has a workaround, see documentation for more info
myColumn.getField("fieldName")

Scenario

getField(name: Any) -> pyspark.sql.column.Column

Action: you can use the snowpark Column indexer operator with the name of the field as the index. Example:

myColumn["fieldName"]

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.

#332: [SIT-1562] SQL Readiness

Change request updated