Issue with SQLExecuteQueryOperator templating with Redshift? #32076
Unanswered
silverbullet1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am using
SQLExecuteQueryOperator
to run a query on Redshift. The query is in a sql file and it expects some parameters. However, I am not able to inject the parameters via templating. Here is some reference code.In my query, I have tried to access the parameters in the following ways:
{{ params.s3_bucket }}, {{ params.s3_key }}
This gives the error:
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 's3_bucket'
2.
%(s3_bucket)s
,%s
,:s3_bucket
, but none of these are being recognized.3. If i change params to parameters in the operator code, then I am able to access s3_bucket, s3_key and iam_role but not source_file_name(which is templated)
You can also follow the earlier discussion on this thread -> https://apache-airflow.slack.com/archives/CCQ7EGB1P/p1686876747984539
Beta Was this translation helpful? Give feedback.
All reactions