SameerMesiah97 opened a new pull request, #63567:
URL: https://github.com/apache/airflow/pull/63567

   **Description**
   
   This change improves the performance of `AzureContainerInstanceHook.exists` 
by replacing the current scan of all container groups in a resource group with 
a direct lookup using `container_groups.get(resource_group, name)`. Instead of 
listing and iterating over all container groups, the hook now performs a single 
API call to determine whether the container group exists.
   
   **Rationale**
   
   Listing container groups can require pagination and multiple API calls as 
the number of resources in a resource group grows. Using the Azure SDK’s direct 
lookup endpoint avoids this overhead and aligns with the intended API usage.
   
   **Tests**
   
   Added/modified unit tests that verify that:
   
   * the hook returns `True` when `container_groups.get` succeeds for an 
existing container group
   * the hook returns `False` when `container_groups.get` raises 
`ResourceNotFoundError`
   * unexpected exceptions raised by `container_groups.get` are propagated 
rather than being swallowed
   
   **Backwards Compatibility**
   
   No change in external behavior. The method still returns `True` when the 
container group exists and `False` when it does not.


-- 
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]

Reply via email to