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
2 changes: 2 additions & 0 deletions providers/samba/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ requires-python = ">=3.10"
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
dependencies = [
"apache-airflow>=2.10.0",
"apache-airflow-providers-common-compat>=1.8.0",
"smbprotocol>=1.5.0",
]

Expand All @@ -73,6 +74,7 @@ dev = [
"apache-airflow",
"apache-airflow-task-sdk",
"apache-airflow-devel-common",
"apache-airflow-providers-common-compat",
"apache-airflow-providers-google",
# Additional devel dependencies (do not remove this line and add extra development dependencies)
]
Expand Down
2 changes: 1 addition & 1 deletion providers/samba/src/airflow/providers/samba/hooks/samba.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import smbclient

from airflow.providers.samba.version_compat import BaseHook
from airflow.providers.common.compat.sdk import BaseHook

if TYPE_CHECKING:
import smbprotocol.connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
from typing import TYPE_CHECKING

from airflow.exceptions import AirflowException
from airflow.providers.common.compat.sdk import BaseOperator
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.providers.samba.hooks.samba import SambaHook
from airflow.providers.samba.version_compat import BaseOperator

WILDCARD = "*"

if TYPE_CHECKING:
from airflow.providers.samba.version_compat import Context
from airflow.providers.common.compat.sdk import Context


class GCSToSambaOperator(BaseOperator):
Expand Down
17 changes: 4 additions & 13 deletions providers/samba/src/airflow/providers/samba/version_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,7 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
AIRFLOW_V_3_1_PLUS: bool = get_base_airflow_version_tuple() >= (3, 1, 0)

if AIRFLOW_V_3_0_PLUS:
from airflow.sdk import BaseOperator
from airflow.sdk.definitions.context import Context
else:
from airflow.models import BaseOperator
from airflow.utils.context import Context

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

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