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

Ash Berlin-Taylor updated AIRFLOW-3910:
---------------------------------------
    Fix Version/s:     (was: 1.10.3)
                   2.0.0

Pulling from 1.10.3 as it causes test failures due to the "Adhoc Query" tests.

> Raise exception explicitly in Connection.get_hook() instead of pass silently
> ----------------------------------------------------------------------------
>
>                 Key: AIRFLOW-3910
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3910
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: models
>    Affects Versions: 1.10.2
>            Reporter: Xiaodong DENG
>            Assignee: Xiaodong DENG
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> Currently in Connection.get_hook(), a try-except clause is used for creating 
> hook based on conn_id and conn_type. If something goes wrong, it pass 
> silently and return None.
>  
> But this may cause trouble. Let’s say I’m getting hook from a postgres 
> connection, while package `psycopg2` is not installed. Then actually getting 
> hook will fail. But it will pass silently, and None will be returned as the 
> hook.
>  
> I found this issue when I’m using SqlSensor for PostgresSQL. I keep getting 
> error 
> “AttributeError: 'NoneType' object has no attribute 'get_records’", but very 
> hard to get a clue what causes this error.
>  
> So here we should raise exception explicitly when anything goes wrong in 
> Connection.get_hook().



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

Reply via email to