I want to call an External Function defined in Snowflake from Snowpark python code. For example, I am trying to manipulate the dataframe like this:
dataframe = dataframe.with_column('name', sql_expr("select test_ext(3,4)"))
However the input to the function sql_expr
is not getting recognized by the python interpretor.
(Here, test_ext() is an External Function which integrates with Azure.)
syntax error line 1 at position 85 unexpected 'select'.
syntax error line 1 at position 103 unexpected '4'.
Am I using the syntax correctly? The official docs do not give any examples for sql_expr
I could not reproduce the same error, but it should work like below:
from snowflake.snowpark.functions import function
test_ext = function("test_ext")
dataframe = dataframe.with_column('name', test_ext(3,4))