You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2024/01/15 11:27:17 UTC
Re: [PR] Fix assignment of template field in `__init__` in `vertex_ai` [airflow]
Taragolis commented on code in PR #36789:
URL: https://github.com/apache/airflow/pull/36789#discussion_r1452258839
##########
airflow/providers/google/cloud/operators/vertex_ai/custom_job.py:
##########
@@ -445,9 +445,19 @@ def __init__(
self,
*,
command: Sequence[str] = [],
+ region: str,
+ parent_model: str | None = None,
+ impersonation_chain: str | Sequence[str] | None = None,
+ dataset_id: str | None = None,
Review Comment:
As I could see parent class already has this arguments, which passed by `**kwargs` it is not necessarily to pass it again.
Templated fields works against class Instance attributes, and not class constructor, and evaluated after task initialised but before it executed on worker (call `execute` method). So if for example parent class already assign `self.region = region` then you don't have to pass it explicitly again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org