Skip to content

Deprecate importing hooks from plugins in Airflow 1.10.13 #9506

@ashb

Description

@ashb

In Airflow 2.0 we should remove the ability to import hooks via the plugin mechanism.

I think we should deprecate adding Operators and Hooks via the Airflow plugin mechanism.

Similar to #9500, but this time for Hooks. (Separate PR as this time we want to keep the ability to register hooks, but for operators even registering should go.)

    from airflow.hooks.my_plugin import MyHook

can become

    from my_plugin import MyHook

with no impact on functionality/user code.

There is still a possible reason to "register" Hooks in a plugin -- namely making the connection types available in the Connections screen. (We don't do that currently, but we should, so keeping the ability to register hooks in a plugin makes sense, even if we deprecate/remove the import mechanism)

Discussed on mailing list here https://lists.apache.org/thread.html/a1453d6a6f113709386b61c68c3f5cd61b258fe78f07811169500fe3%40%3Cdev.airflow.apache.org%3E

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions