Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""This module contains a Apache Beam Hook."""

from __future__ import annotations

import asyncio
Expand All @@ -37,13 +35,9 @@
from packaging.version import Version

from airflow.exceptions import AirflowConfigException, AirflowException
from airflow.providers.apache.beam.version_compat import BaseHook
from airflow.providers.common.compat.standard.utils import prepare_virtualenv

try:
from airflow.sdk import BaseHook
except ImportError:
from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]

if TYPE_CHECKING:
import logging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
AIRFLOW_V_3_1_PLUS = get_base_airflow_version_tuple() >= (3, 1, 0)

if AIRFLOW_V_3_1_PLUS:
from airflow.sdk import BaseOperator
from airflow.sdk import BaseHook, BaseOperator
else:
from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]
from airflow.models import BaseOperator

__all__ = [
"AIRFLOW_V_3_1_PLUS",
"BaseHook",
"BaseOperator",
]