You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/06/19 21:25:21 UTC

[airflow] branch main updated: Add DeprecationWarning for column_transformations parameter in AutoML (#24467)

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

potiuk 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 0561c1aac4 Add DeprecationWarning for column_transformations parameter in AutoML (#24467)
0561c1aac4 is described below

commit 0561c1aac4d0ba6ddebfe086243e2d148a394214
Author: Maksim <ma...@gmail.com>
AuthorDate: Mon Jun 20 00:25:04 2022 +0300

    Add DeprecationWarning for column_transformations parameter in AutoML (#24467)
---
 airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py b/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py
index 26d3425368..12c480a28d 100644
--- a/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py
+++ b/airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py
@@ -44,6 +44,7 @@ This module contains a Google Cloud Vertex AI hook.
     optimizationObjective
 """
 
+import warnings
 from typing import Dict, List, Optional, Sequence, Tuple, Union
 
 from google.api_core.client_options import ClientOptions
@@ -444,6 +445,13 @@ class AutoMLHook(GoogleBaseHook):
             concurrent Future and any downstream object will be immediately returned and synced when the
             Future has completed.
         """
+        if column_transformations:
+            warnings.warn(
+                "Consider using column_specs as column_transformations will be deprecated eventually.",
+                DeprecationWarning,
+                stacklevel=2,
+            )
+
         self._job = self.get_auto_ml_tabular_training_job(
             project=project_id,
             location=region,
@@ -658,6 +666,13 @@ class AutoMLHook(GoogleBaseHook):
             concurrent Future and any downstream object will be immediately returned and synced when the
             Future has completed.
         """
+        if column_transformations:
+            warnings.warn(
+                "Consider using column_specs as column_transformations will be deprecated eventually.",
+                DeprecationWarning,
+                stacklevel=2,
+            )
+
         self._job = self.get_auto_ml_forecasting_training_job(
             project=project_id,
             location=region,