You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeploymentResourcePool.query_deployed_models returns page containers instead of DeployedModelRef objects #7230
google-cloud-aiplatform version: 2.5.0 (main at faed3f4)
Steps to reproduce
Call query_deployed_models() on a DeploymentResourcePool where the response has one page holding two deployed model refs.
Read deployed_model_id from the first item of the returned list.
query_deployed_models documents its return value as a list of DeployedModelRef objects, but it builds the list with itertools.chain(page.deployed_model_refs for page in response.pages). Called with a single generator, chain does not flatten anything, so each item in the result is one page's RepeatedComposite of refs. With one page holding two refs the method returns a list of length 1, and every item is a container, not a ref. The same line is in google/cloud/aiplatform/models.py and google/cloud/aiplatform/preview/models.py.
The existing unit test uses two pages with one ref each and only checks len(dm_refs) == 2, so it passes with the bug.
Code example
Only the two client calls are stubbed, everything else is the real SDK code path:
Activity