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 7883bcc85c Fix assignment of template field in `__init__` in
`custom_job` (#36789)
7883bcc85c is described below
commit 7883bcc85cee3826540b65eb6522320044931436
Author: rom sharon <[email protected]>
AuthorDate: Wed Feb 7 17:01:53 2024 +0200
Fix assignment of template field in `__init__` in `custom_job` (#36789)
* Fix assignment of template field in __init__ in vertex_ai
* remove file from exclude
---
.pre-commit-config.yaml | 1 -
.../google/cloud/operators/vertex_ai/custom_job.py | 36 ++++++++++++++++++++--
2 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 8be555de3a..f1697038d4 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -331,7 +331,6 @@ repos:
^airflow\/providers\/google\/cloud\/transfers\/bigquery_to_mysql\.py$|
^airflow\/providers\/amazon\/aws\/transfers\/redshift_to_s3\.py$|
^airflow\/providers\/google\/cloud\/operators\/compute\.py$|
-
^airflow\/providers\/google\/cloud\/operators\/vertex_ai\/custom_job\.py$|
^airflow\/providers\/amazon\/aws\/operators\/emr\.py$|
^airflow\/providers\/amazon\/aws\/operators\/eks\.py$
)$
diff --git a/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py
b/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py
index 0b3d221675..e94c39efea 100644
--- a/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py
+++ b/airflow/providers/google/cloud/operators/vertex_ai/custom_job.py
@@ -445,9 +445,19 @@ class
CreateCustomContainerTrainingJobOperator(CustomTrainingJobBaseOperator):
self,
*,
command: Sequence[str] = [],
+ region: str,
+ parent_model: str | None = None,
+ impersonation_chain: str | Sequence[str] | None = None,
+ dataset_id: str | None = None,
**kwargs,
) -> None:
- super().__init__(**kwargs)
+ super().__init__(
+ region=region,
+ parent_model=parent_model,
+ impersonation_chain=impersonation_chain,
+ dataset_id=dataset_id,
+ **kwargs,
+ )
self.command = command
def execute(self, context: Context):
@@ -816,9 +826,19 @@ class
CreateCustomPythonPackageTrainingJobOperator(CustomTrainingJobBaseOperator
*,
python_package_gcs_uri: str,
python_module_name: str,
+ region: str,
+ parent_model: str | None = None,
+ impersonation_chain: str | Sequence[str] | None = None,
+ dataset_id: str | None = None,
**kwargs,
) -> None:
- super().__init__(**kwargs)
+ super().__init__(
+ region=region,
+ parent_model=parent_model,
+ impersonation_chain=impersonation_chain,
+ dataset_id=dataset_id,
+ **kwargs,
+ )
self.python_package_gcs_uri = python_package_gcs_uri
self.python_module_name = python_module_name
@@ -1190,9 +1210,19 @@ class
CreateCustomTrainingJobOperator(CustomTrainingJobBaseOperator):
*,
script_path: str,
requirements: Sequence[str] | None = None,
+ region: str,
+ parent_model: str | None = None,
+ impersonation_chain: str | Sequence[str] | None = None,
+ dataset_id: str | None = None,
**kwargs,
) -> None:
- super().__init__(**kwargs)
+ super().__init__(
+ region=region,
+ parent_model=parent_model,
+ impersonation_chain=impersonation_chain,
+ dataset_id=dataset_id,
+ **kwargs,
+ )
self.requirements = requirements
self.script_path = script_path