nuclearpinguin commented on a change in pull request #7484: [AIRFLOW-6864][depends on 6863] Make airflow/jobs pylint compatible URL: https://github.com/apache/airflow/pull/7484#discussion_r382910829
########## File path: airflow/models/sqla_models.py ########## @@ -0,0 +1,13 @@ +"""Load SQLAlchemy models during package initialization""" + +# pylint: disable=unused-import + +# Must be loaded after loading DAG model. +# noinspection PyUnresolvedReferences +from airflow.jobs.base_job import BaseJob # isort # isort:skip +# noinspection PyUnresolvedReferences +from airflow.jobs.scheduler_job import SchedulerJob # isort # isort:skip +# noinspection PyUnresolvedReferences +from airflow.jobs.backfill_job import BackfillJob # isort # isort:skip +# noinspection PyUnresolvedReferences +from airflow.jobs.local_task_job import LocalTaskJob # isort # isort:skip Review comment: The whole content of `airflow/models/__init__.py` should be moved here in the next steps. And then in `airflow/utils/db.py` we should replace `from airflow.models import ...` to `from airflow.models.sqla_models`. In this way, we should be able to avoid a lot of cyclic imports. After all it may be possible to get rid of this file always use explicit import like `from airflow.models.dag import DAG`. WDYT? @ashb @potiuk ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
