SPRKPY1078
pyspark.context.SparkContext.setLogLevel
Message: The argument of the pyspark.context.SparkContext.setLogLevel function is not a literal value and therefore could not be evaluated
Category: Warning
Description
This issue appears when the SMA detects the use of the pyspark.context.SparkContext.setLogLevel function with an argument that is not a literal value, for example, when the argument is a variable.
The SMA does a static analysis of your source code and therefore it is not possible to evaluate the content of that argument and determine an equivalent in Snowpark.
Scenario
Input
In this example the logLevel is defined in the variable my_log_level, then my_log_level used as parameter by the setLogLevel method.
Output
SMA is unable to evaluate the argument for the log level parameter, so the EWI SPRKPY1078 is added over the line of the transformed logging:
Recommended fix
Even though the SMA was unable to evaluate the argument, it will transform the pyspark.context.SparkContext.setLogLevel
function into the Snowpark equivalent. Please make sure the value of the level
argument in the generated output code is a valid and equivalent log level in Snowpark according to the table below:
ALL
logging.NOTSET
DEBUG
logging.DEBUG
ERROR
logging.ERROR
FATAL
logging.CRITICAL
INFO
logging.INFO
OFF
logging.WARNING
TRACE
logging.NOTSET
WARN
logging.WARNING
Thus the recommended fix will looks like:
Additional recommendations
For more support, you can email us at sma-support@snowflake.com or post an issue in the SMA.
Last updated