You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Jarek Potiuk (Jira)" <ji...@apache.org> on 2020/01/19 23:37:07 UTC

[jira] [Closed] (AIRFLOW-1307) Creating a new Hook requires modifying models.py

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

Jarek Potiuk closed AIRFLOW-1307.
---------------------------------
    Resolution: Won't Fix

I am closing some old issues that are not relevant any more. Please let me know if you want to reopen it.

> 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
>            Priority: Major
>              Labels: features
>
> 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
(v8.3.4#803005)