Airflow 2.1.0: Snowflake connection not enabling snowflake "role"
See original GitHub issueApache Airflow version: 2.1.0
Kubernetes version (if you are using kubernetes) (use kubectl version
):
Environment:
- Cloud provider or hardware configuration: AWS EKS, AWS ECS
- OS (e.g. from /etc/os-release): Debian GNU/Linux 10
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
What happened: When creating a snowflake connector using a snowflake hook(using UI), not able to add snowflake roles in the extras. here is the screenshot of the connection which I am creating
but once I am done saving it I lose the role and if I edit my connection this is what I see in the UI
so Extra gets populated with all the other placeholders. I can see that https://github.com/apache/airflow/blob/4b14d93f25f237b8cca17f57352c253f292a111b/airflow/providers/snowflake/hooks/snowflake.py#L89 you guys are returning some value to the widget but it is not having a snowflake “role” definition.
I also updated the JSON object and created it as a nested JSON {{"role": "test"}}
following the placeholder
from the above function but still, the behaviour remains the same.
What you expected to happen:
"placeholders": {
'extra': json.dumps(
{
"role": "snowflake role",
"authenticator": "snowflake oauth",
"private_key_file": "private key",
"session_parameters": "session parameters",
},
indent=1,
),
'host': 'snowflake hostname',
'schema': 'snowflake schema',
'login': 'snowflake username',
'password': 'snowflake password',
'extra__snowflake__account': 'snowflake account name',
'extra__snowflake__warehouse': 'snowflake warehouse name',
'extra__snowflake__database': 'snowflake db name',
'extra__snowflake__region': 'snowflake hosted region',
'extra__snowflake__aws_access_key_id': 'aws access key id (S3ToSnowflakeOperator)',
'extra__snowflake__aws_secret_access_key': 'aws secret access key (S3ToSnowflakeOperator)',
}
If I follow above code I should be able to pass the snowflake role into the Extras. But this behaiour is missing
How to reproduce it:
Create a connection with connection type snowflake in airflow UI.
Anything else we need to know:
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Issue is closed, but wanted to note that the same issue is happening when trying to add a private key file (using “private_key_file” parameter) in the Extra field. I am using Apache Airflow 2.1.0. Should I file a new bug report?
See: https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#contribution-workflow