Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-1307

Creating a new Hook requires modifying models.py

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.1
    • Fix Version/s: None
    • Component/s: hooks, models
    • Labels:
    • Flags:
      Important

      Description

      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.

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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bernardocaldas Bernardo Caldas
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: