Skip to content

Commit

Permalink
Add DeprecationWarning for column_transformations parameter in AutoML (
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksYermak committed Jun 19, 2022
1 parent 5674491 commit 0561c1a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
optimizationObjective
"""

import warnings
from typing import Dict, List, Optional, Sequence, Tuple, Union

from google.api_core.client_options import ClientOptions
Expand Down Expand Up @@ -444,6 +445,13 @@ def create_auto_ml_tabular_training_job(
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,
Expand Down Expand Up @@ -658,6 +666,13 @@ def create_auto_ml_forecasting_training_job(
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,
Expand Down

0 comments on commit 0561c1a

Please sign in to comment.