I am messing around with some python and snowflake. I am using a JSON file to store my connection info like this:
{
"snowflake_config": {
"user": "automation",
"password": "************",
"account": "someaccounthere",
"warehouse": "somewarehousehere",
"database": "somedatabasehere",
"schema": "someschemahere"
}
}
But I have a few hundred SQL queries that I would like to run that will accept arguments. Can I store them in a json file as well? Or does snowflake using execute_stream really require the file to be static? I was hoping I could do something like this (pseudo code):
{
"snowflake_queries": {
"sql1": "GRANT SELECT ON ALL TABLES IN SCHEMA %s<this is argparse1> to role <argparse2>",
"sql2": "GRANT SELECT ON ALL VIEWS IN SCHEMA %s<this is argparse1> to role <argparse2>"
}
}