You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Ash Berlin-Taylor (Jira)" <ji...@apache.org> on 2019/08/28 12:24:00 UTC

[jira] [Resolved] (AIRFLOW-3705) PostgresHook's get_conn method calls incorrect attribute by default

     [ https://issues.apache.org/jira/browse/AIRFLOW-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ash Berlin-Taylor resolved AIRFLOW-3705.
----------------------------------------
    Fix Version/s: 1.10.6
       Resolution: Fixed

> PostgresHook's get_conn method calls incorrect attribute by default 
> --------------------------------------------------------------------
>
>                 Key: AIRFLOW-3705
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3705
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: database
>    Affects Versions: 1.10.2
>            Reporter: Cooper Gillan
>            Assignee: Cooper Gillan
>            Priority: Minor
>             Fix For: 1.10.6
>
>
> Sub-classing {{PostgresHook}} to specify separate connections is currently not possible due to [{{get_conn}} callingĀ {{self.postgres_conn_id}} directly|https://github.com/apache/airflow/blob/c030729dcbe35a2a4869e46b57a761c8376ede8d/airflow/hooks/postgres_hook.py#L46]. It should be possible to set different values for [{{self.conn_name_attr}}|https://github.com/apache/airflow/blob/c030729dcbe35a2a4869e46b57a761c8376ede8d/airflow/hooks/postgres_hook.py#L37], in sub-classes of the hook.
> For example, if sub-classing {{PostgresHook}} to set up separate named connections to multiple Postgres instances, the {{postgres_conn_id}} of the sub-class must be set specifically. This is true despite the fact that {{conn_name_attr}} is set up in a way that should allow any connection to be specified.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)