Xiaodong DENG created AIRFLOW-2839:
--------------------------------------

             Summary: Answer a question in doc: what if I have connections with 
the same conn_id in both metadata and environment variables?
                 Key: AIRFLOW-2839
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2839
             Project: Apache Airflow
          Issue Type: Improvement
          Components: configuration, Documentation
            Reporter: Xiaodong DENG
            Assignee: Xiaodong DENG


We can define connections either in metadata database or environment variables.
 
However, how about there are connections with the same conn_id in both metadata 
database and environment variables? Will one of them be picked? Which one? Or a 
random one will be picked?
 
The answer is: Airflow will check environment variables 
first.[https://github.com/apache/incubator-airflow/blob/master/airflow/hooks/base_hook.py#L70]
  The "random picking" mechanism will only be applicable for multiple 
connections with the same conn_id in metadata database (if there is no 
connection with the same conn_id defined in environment variables).
 
This should be made clear in the documentation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to