This is an automated email from the ASF dual-hosted git repository.

husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new f56acdad16 Deprecate Life Sciences Operator and Hook (#34549)
f56acdad16 is described below

commit f56acdad164586f8be8c21137d927fdfd01e8bb4
Author: Freddy Demiane <[email protected]>
AuthorDate: Fri Sep 22 22:14:44 2023 +0200

    Deprecate Life Sciences Operator and Hook (#34549)
    
    * Deprecate Life Sciences Operator and Hook
    
    * Update airflow/providers/google/cloud/hooks/life_sciences.py
    
    Co-authored-by: Andrey Anshin <[email protected]>
    
    * Update airflow/providers/google/cloud/operators/life_sciences.py
    
    Co-authored-by: Andrey Anshin <[email protected]>
    
    ---------
    
    Co-authored-by: Andrey Anshin <[email protected]>
---
 airflow/providers/google/cloud/hooks/life_sciences.py    | 16 +++++++++++++++-
 .../providers/google/cloud/operators/life_sciences.py    | 16 +++++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/google/cloud/hooks/life_sciences.py 
b/airflow/providers/google/cloud/hooks/life_sciences.py
index e3cd01c6c3..46c0f2e3dc 100644
--- a/airflow/providers/google/cloud/hooks/life_sciences.py
+++ b/airflow/providers/google/cloud/hooks/life_sciences.py
@@ -19,12 +19,13 @@
 from __future__ import annotations
 
 import time
+import warnings
 from typing import Sequence
 
 import google.api_core.path_template
 from googleapiclient.discovery import build
 
-from airflow.exceptions import AirflowException
+from airflow.exceptions import AirflowException, 
AirflowProviderDeprecationWarning
 from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
 
 # Time to sleep between active checks of the operation results
@@ -35,6 +36,11 @@ class LifeSciencesHook(GoogleBaseHook):
     """
     Hook for the Google Cloud Life Sciences APIs.
 
+    .. warning::
+        This hook is deprecated. Consider using Google Cloud Batch Operators' 
hook instead.
+        The Life Sciences API (beta) will be discontinued on July 8, 2025 in 
favor
+        of Google Cloud Batch.
+
     All the methods in the hook where project_id is used must be called with
     keyword arguments rather than positional.
 
@@ -70,6 +76,14 @@ class LifeSciencesHook(GoogleBaseHook):
         )
         self.api_version = api_version
 
+        warnings.warn(
+            """This hook is deprecated. Consider using Google Cloud Batch 
Operators' hook instead.
+            The Life Sciences API (beta) will be discontinued on July 8, 2025 
in favor
+            of Google Cloud Batch.""",
+            AirflowProviderDeprecationWarning,
+            stacklevel=3,
+        )
+
     def get_conn(self) -> build:
         """
         Retrieves the connection to Cloud Life Sciences.
diff --git a/airflow/providers/google/cloud/operators/life_sciences.py 
b/airflow/providers/google/cloud/operators/life_sciences.py
index bb2b5329e0..a890918fad 100644
--- a/airflow/providers/google/cloud/operators/life_sciences.py
+++ b/airflow/providers/google/cloud/operators/life_sciences.py
@@ -18,9 +18,10 @@
 """Operators that interact with Google Cloud Life Sciences service."""
 from __future__ import annotations
 
+import warnings
 from typing import TYPE_CHECKING, Sequence
 
-from airflow.exceptions import AirflowException
+from airflow.exceptions import AirflowException, 
AirflowProviderDeprecationWarning
 from airflow.providers.google.cloud.hooks.life_sciences import LifeSciencesHook
 from airflow.providers.google.cloud.links.life_sciences import LifeSciencesLink
 from airflow.providers.google.cloud.operators.cloud_base import 
GoogleCloudBaseOperator
@@ -33,6 +34,11 @@ class 
LifeSciencesRunPipelineOperator(GoogleCloudBaseOperator):
     """
     Runs a Life Sciences Pipeline.
 
+    .. warning::
+        This operator is deprecated. Consider using Google Cloud Batch 
Operators instead.
+        The Life Sciences API (beta) will be discontinued on July 8, 2025 in 
favor
+        of Google Cloud Batch.
+
     .. seealso::
         For more information on how to use this operator, take a look at the 
guide:
         :ref:`howto/operator:LifeSciencesRunPipelineOperator`
@@ -81,6 +87,14 @@ class 
LifeSciencesRunPipelineOperator(GoogleCloudBaseOperator):
         self._validate_inputs()
         self.impersonation_chain = impersonation_chain
 
+        warnings.warn(
+            """This operator is deprecated. Consider using Google Cloud Batch 
Operators instead.
+            The Life Sciences API (beta) will be discontinued on July 8, 2025 
in favor
+            of Google Cloud Batch.""",
+            AirflowProviderDeprecationWarning,
+            stacklevel=3,
+        )
+
     def _validate_inputs(self) -> None:
         if not self.body:
             raise AirflowException("The required parameter 'body' is missing")

Reply via email to