saurasingh opened a new issue #16717:
URL: https://github.com/apache/airflow/issues/16717


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the 
following questions.
   Don't worry if they're not all applicable; just try to include what you can 
:-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the 
context.
   
   -->
   
   **Apache 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 
   ![Screen Shot 2021-06-29 at 1 31 33 
PM](https://user-images.githubusercontent.com/19628707/123842261-92abbd00-d8de-11eb-93ae-baf29999ba9d.png)
   
   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
   
   ![Screen Shot 2021-06-29 at 1 32 18 
PM](https://user-images.githubusercontent.com/19628707/123842357-b111b880-d8de-11eb-9a73-146b0b069851.png)
   
   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.
   
   
https://github.com/apache/airflow/blob/4b14d93f25f237b8cca17f57352c253f292a111b/airflow/providers/snowflake/hooks/snowflake.py#L105
 
   
   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. 
   <!-- (please include exact error messages if you can) -->
   
   **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
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   
   Create a connection with connection type snowflake in airflow UI.
   
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access 
to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using 
minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a 
youtube video of the bug in action
   
   You can include images using the .md style of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an 
unlisted youtube video with the resulting .mov file.
   
   --->
   
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to