diff --git a/airflow/auth/managers/fab/fab_auth_manager.py b/airflow/auth/managers/fab/fab_auth_manager.py index 290329dcc8530..be50c574709a4 100644 --- a/airflow/auth/managers/fab/fab_auth_manager.py +++ b/airflow/auth/managers/fab/fab_auth_manager.py @@ -20,7 +20,6 @@ import warnings from typing import TYPE_CHECKING -from airflow import AirflowException from airflow.auth.managers.base_auth_manager import BaseAuthManager from airflow.auth.managers.fab.cli_commands.definition import ( ROLES_COMMANDS, @@ -30,6 +29,7 @@ from airflow.cli.cli_config import ( GroupCommand, ) +from airflow.exceptions import AirflowException if TYPE_CHECKING: from airflow.auth.managers.fab.models import User diff --git a/airflow/auth/managers/fab/security_manager/override.py b/airflow/auth/managers/fab/security_manager/override.py index 66032dc166834..4b884c303ab63 100644 --- a/airflow/auth/managers/fab/security_manager/override.py +++ b/airflow/auth/managers/fab/security_manager/override.py @@ -40,9 +40,9 @@ from sqlalchemy.exc import MultipleResultsFound from werkzeug.security import generate_password_hash -from airflow import AirflowException from airflow.auth.managers.fab.models import Action, Permission, RegisterUser, Resource, Role from airflow.auth.managers.fab.models.anonymous_user import AnonymousUser +from airflow.exceptions import AirflowException from airflow.www.security_manager import AirflowSecurityManagerV2 from airflow.www.session import AirflowDatabaseSessionInterface diff --git a/airflow/decorators/setup_teardown.py b/airflow/decorators/setup_teardown.py index ecb3dc289f2d6..14123ebc32c3a 100644 --- a/airflow/decorators/setup_teardown.py +++ b/airflow/decorators/setup_teardown.py @@ -19,9 +19,9 @@ import types from typing import TYPE_CHECKING, Callable -from airflow import AirflowException from airflow.decorators import python_task from airflow.decorators.task_group import _TaskGroupFactory +from airflow.exceptions import AirflowException from airflow.models import BaseOperator from airflow.utils.setup_teardown import SetupTeardownContext diff --git a/airflow/utils/db_cleanup.py b/airflow/utils/db_cleanup.py index cbc93c0d4459a..4e3f3e1510c8a 100644 --- a/airflow/utils/db_cleanup.py +++ b/airflow/utils/db_cleanup.py @@ -35,9 +35,9 @@ from sqlalchemy.orm import aliased from sqlalchemy.sql.expression import ClauseElement, Executable, tuple_ -from airflow import AirflowException from airflow.cli.simple_table import AirflowConsole from airflow.configuration import conf +from airflow.exceptions import AirflowException from airflow.utils import timezone from airflow.utils.db import reflect_tables from airflow.utils.helpers import ask_yesno diff --git a/airflow/utils/dot_renderer.py b/airflow/utils/dot_renderer.py index 05b91d9fc8bae..41281fbbb1610 100644 --- a/airflow/utils/dot_renderer.py +++ b/airflow/utils/dot_renderer.py @@ -23,7 +23,7 @@ import graphviz -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.models.baseoperator import BaseOperator from airflow.models.mappedoperator import MappedOperator from airflow.utils.dag_edges import dag_edges diff --git a/tests/always/test_connection.py b/tests/always/test_connection.py index 3261ebaeb5c04..1159f3c476fc6 100644 --- a/tests/always/test_connection.py +++ b/tests/always/test_connection.py @@ -27,7 +27,7 @@ import sqlalchemy from cryptography.fernet import Fernet -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.hooks.base import BaseHook from airflow.models import Connection, crypto from airflow.providers.sqlite.hooks.sqlite import SqliteHook diff --git a/tests/auth/managers/fab/test_fab_auth_manager.py b/tests/auth/managers/fab/test_fab_auth_manager.py index c245ec629cb0f..3d2bcfed676db 100644 --- a/tests/auth/managers/fab/test_fab_auth_manager.py +++ b/tests/auth/managers/fab/test_fab_auth_manager.py @@ -21,10 +21,10 @@ import pytest -from airflow import AirflowException from airflow.auth.managers.fab.fab_auth_manager import FabAuthManager from airflow.auth.managers.fab.models import User from airflow.auth.managers.fab.security_manager.override import FabAirflowSecurityManagerOverride +from airflow.exceptions import AirflowException from airflow.www.security_appless import ApplessAirflowSecurityManager diff --git a/tests/listeners/test_listeners.py b/tests/listeners/test_listeners.py index 166c3a5f03ef9..2ec6c4e45a214 100644 --- a/tests/listeners/test_listeners.py +++ b/tests/listeners/test_listeners.py @@ -21,7 +21,7 @@ import pytest -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.jobs.job import Job, run_job from airflow.listeners.listener import get_listener_manager from airflow.operators.bash import BashOperator diff --git a/tests/models/test_connection.py b/tests/models/test_connection.py index 0223cffb8db6e..cac38c1451857 100644 --- a/tests/models/test_connection.py +++ b/tests/models/test_connection.py @@ -21,7 +21,7 @@ import pytest -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.models import Connection diff --git a/tests/models/test_dagcode.py b/tests/models/test_dagcode.py index d3b38761ca381..07a952d23cfbf 100644 --- a/tests/models/test_dagcode.py +++ b/tests/models/test_dagcode.py @@ -22,7 +22,8 @@ import pytest -from airflow import AirflowException, example_dags as example_dags_module +import airflow.example_dags as example_dags_module +from airflow.exceptions import AirflowException from airflow.models import DagBag from airflow.models.dagcode import DagCode diff --git a/tests/utils/test_db_cleanup.py b/tests/utils/test_db_cleanup.py index af243342b875d..39dc314cc702f 100644 --- a/tests/utils/test_db_cleanup.py +++ b/tests/utils/test_db_cleanup.py @@ -31,7 +31,7 @@ from sqlalchemy.exc import OperationalError from sqlalchemy.ext.declarative import DeclarativeMeta -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.models import DagModel, DagRun, TaskInstance from airflow.operators.python import PythonOperator from airflow.utils.db_cleanup import ( diff --git a/tests/utils/test_helpers.py b/tests/utils/test_helpers.py index dad1e4dba6509..d16bf398b58a8 100644 --- a/tests/utils/test_helpers.py +++ b/tests/utils/test_helpers.py @@ -23,7 +23,7 @@ import pytest -from airflow import AirflowException +from airflow.exceptions import AirflowException from airflow.jobs.base_job_runner import BaseJobRunner from airflow.utils import helpers, timezone from airflow.utils.helpers import (