You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/02/21 19:14:35 UTC
[GitHub] [airflow] potiuk commented on a change in pull request #7456:
[AIRFLOW-6817] - Move airflow __init__.py imports to sub-packages
potiuk commented on a change in pull request #7456: [AIRFLOW-6817] - Move airflow __init__.py imports to sub-packages
URL: https://github.com/apache/airflow/pull/7456#discussion_r382758098
##########
File path: tests/jobs/test_local_task_job.py
##########
@@ -24,10 +24,11 @@
import pytest
from mock import patch
-from airflow import AirflowException, models, settings
+from airflow import settings
+from airflow.exceptions import AirflowException
from airflow.executors.sequential_executor import SequentialExecutor
from airflow.jobs import LocalTaskJob
-from airflow.models import DAG, TaskInstance as TI
+from airflow.models import DAG, DagBag, TaskInstance as TI
Review comment:
This is a bit tricky, because we are relying on it in "resetdb" case. The models when imported register themselves in sqlalchemy and resetdb uses that information to know which tables to delete. However we already have some exceptions to that - some models are moved out of models package __init__.py and have to be added manually to resetdb.
I think what would make more sense is to have a separate models/all_models.py which would import all models and this one can be used by resetdb,
But I think we should make a separate PR for that.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services