apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
36.85k stars 14.25k forks source link

Airflow upgrade_check likely issuing false warnings #14340

Closed r-richmond closed 3 years ago

r-richmond commented 3 years ago

Apache Airflow version: 1.10.14

Environment:

Installed Versions ``` apache-airflow 1.10.14 apache-airflow-backport-providers-apache-hdfs 2020.10.29 apache-airflow-backport-providers-apache-spark 2020.10.29 apache-airflow-backport-providers-apache-sqoop 2020.10.29 apache-airflow-backport-providers-google 2021.2.5 apache-airflow-backport-providers-http 2021.2.5 apache-airflow-backport-providers-jdbc 2020.10.29 apache-airflow-backport-providers-postgres 2020.10.29 apache-airflow-backport-providers-salesforce 2020.10.29 apache-airflow-backport-providers-sftp 2021.2.5 apache-airflow-backport-providers-slack 2021.2.5 apache-airflow-backport-providers-ssh 2021.2.5 apache-airflow-upgrade-check 1.2.0 ```

What happened:

Running airflow upgrade_check threw the following warning

2. Class <class 'airflow.hooks.http_hook.HttpHook'> incorrectly implements the function run while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead

I thought that replacing it with the provider pathed hook would make this go away but instead

1. Class <class 'airflow.providers.http.hooks.http.HttpHook'> incorrectly implements the function run while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead

Full output ``` Hooks that run DB functions must inherit from DBApiHook ------------------------------------------------------- Hooks that run DB functions must inherit from DBApiHook instead of BaseHook Problems: 1. Class incorrectly implements the function run while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead 2. Class incorrectly implements the function run while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead 3. Class incorrectly implements the function get_pandas_df while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead 4. Class incorrectly implements the function get_records while inheriting from BaseHook. Please make this class inherit from airflow.hooks.db_api_hook.DbApiHook instead ```

What you expected to happen: No warnings for builtin airflow hooks

How to reproduce it:

Anything else we need to know:

Discussion Thread in Slack:

kaxil commented 3 years ago

Fixed by https://github.com/apache/airflow/pull/14344 and will be released in upgrade check 1.3.0