Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove parent_model version suffix if passed to Vertex AI operators #39640

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
5 changes: 5 additions & 0 deletions airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def execute(self, context: Context):
gcp_conn_id=self.gcp_conn_id,
impersonation_chain=self.impersonation_chain,
)
self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None
model, training_id = self.hook.create_auto_ml_forecasting_training_job(
project_id=self.project_id,
region=self.region,
Expand Down Expand Up @@ -283,6 +284,7 @@ def execute(self, context: Context):
gcp_conn_id=self.gcp_conn_id,
impersonation_chain=self.impersonation_chain,
)
self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None
model, training_id = self.hook.create_auto_ml_image_training_job(
project_id=self.project_id,
region=self.region,
Expand Down Expand Up @@ -391,6 +393,7 @@ def execute(self, context: Context):
impersonation_chain=self.impersonation_chain,
)
credentials, _ = self.hook.get_credentials_and_project_id()
self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None
model, training_id = self.hook.create_auto_ml_tabular_training_job(
project_id=self.project_id,
region=self.region,
Expand Down Expand Up @@ -485,6 +488,7 @@ def execute(self, context: Context):
gcp_conn_id=self.gcp_conn_id,
impersonation_chain=self.impersonation_chain,
)
self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None
model, training_id = self.hook.create_auto_ml_text_training_job(
project_id=self.project_id,
region=self.region,
Expand Down Expand Up @@ -561,6 +565,7 @@ def execute(self, context: Context):
gcp_conn_id=self.gcp_conn_id,
impersonation_chain=self.impersonation_chain,
)
self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None
model, training_id = self.hook.create_auto_ml_video_training_job(
project_id=self.project_id,
region=self.region,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ def __init__(
def execute(self, context: Context):
super().execute(context)

self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None

if self.deferrable:
self.invoke_defer(context=context)

Expand Down Expand Up @@ -966,6 +968,8 @@ def __init__(
def execute(self, context: Context):
super().execute(context)

self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None

if self.deferrable:
self.invoke_defer(context=context)

Expand Down Expand Up @@ -1446,6 +1450,8 @@ def __init__(
def execute(self, context: Context):
super().execute(context)

self.parent_model = self.parent_model.split("@")[0] if self.parent_model else None

if self.deferrable:
self.invoke_defer(context=context)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ The same operation can be performed in the deferrable mode:
.. exampleinclude:: /../../tests/system/providers/google/cloud/vertex_ai/example_vertex_ai_custom_job.py
:language: python
:dedent: 4
:start-after: [START how_to_cloud_vertex_ai_create_custom_training_job_v2_operator_deferrable]
:end-before: [END how_to_cloud_vertex_ai_create_custom_training_job_v2_operator_deferrable]
:start-after: [START how_to_cloud_vertex_ai_create_custom_training_job_v2_deferrable_operator]
:end-before: [END how_to_cloud_vertex_ai_create_custom_training_job_v2_deferrable_operator]


You can get a list of Training Jobs using
Expand Down
Loading