airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernardo Caldas (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-1307) Creating a new Hook requires modifying models.py
Date Wed, 14 Jun 2017 13:25:00 GMT
Bernardo Caldas created AIRFLOW-1307:
----------------------------------------

             Summary: Creating a new Hook requires modifying models.py
                 Key: AIRFLOW-1307
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1307
             Project: Apache Airflow
          Issue Type: Improvement
          Components: hooks, models
    Affects Versions: 1.8.1
            Reporter: Bernardo Caldas


if I create a new hook, I need to go and change models.py to add it to the connection types
and to be able to return my custom hook. For instance, in my plugins, I created a SybaseHook,
and I had to add this code to the get_hook method.


{code:python}
            elif self.conn_type == 'sybase':
                from airflow.hooks.sybase_plugin import SybaseHook
                return SybaseHook(sybase_conn_id=self.conn_id)
{code}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message