I am using a databricks notebook and I would like to pass several python variables to an SQL query using koalas.sql.
Here a simplified example of what I am trying to do.
import databricks.koalas as ks
query = """
SELECT *
FROM my_database
WHERE animal = pyth_var
"""
ks.sql(query, globals = {'pyth_var':'dog'})
But the python variable cannot be read. I get:
AnalysisException: cannot resolve '
pyth_var
' given input columns