Skip to content

Commit

Permalink
Deprecate get_hook method in DockerOperator (#34432)
Browse files Browse the repository at this point in the history
* Deprecate get_hook method in DockerOperator

* use AirflowProviderDeprecationWarning
  • Loading branch information
hussein-awala committed Sep 18, 2023
1 parent bbfa228 commit d75e5ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions airflow/providers/docker/operators/docker.py
Expand Up @@ -28,6 +28,7 @@
from tempfile import TemporaryDirectory
from typing import TYPE_CHECKING, Iterable, Sequence

from deprecated.classic import deprecated
from docker.constants import DEFAULT_TIMEOUT_SECONDS
from docker.errors import APIError
from docker.types import LogConfig, Mount, Ulimit
Expand Down Expand Up @@ -328,6 +329,7 @@ def hook(self) -> DockerHook:
timeout=self.timeout,
)

@deprecated(reason="use `hook` property instead.", category=AirflowProviderDeprecationWarning)
def get_hook(self) -> DockerHook:
"""Create and return an DockerHook (cached)."""
return self.hook
Expand Down

0 comments on commit d75e5ef

Please sign in to comment.