cruseakshay commented on code in PR #62772:
URL: https://github.com/apache/airflow/pull/62772#discussion_r2899290278
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/container_instances.py:
##########
@@ -303,12 +315,14 @@ def _ensure_identity(identity: ContainerGroupIdentity |
dict | None) -> Containe
)
return identity
+ @cached_property
+ def _ci_hook(self) -> AzureContainerInstanceHook:
+ return AzureContainerInstanceHook(azure_conn_id=self.ci_conn_id)
+
Review Comment:
This is consistent with ADF/Synapse operators. The benefit is lazy
initialization for execute() and execute_complete(), since both methods require
the hook. With @cached_property, we define it once and avoid duplicating the
instantiation logic across both methods.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]