Skip to content

[pipeline-fix] Fix pipeline failure for #47694 #48726

Description

@github-actions

Fixes Pyright errors introduced in the RLE patch files for azure-ai-projects.

Source PR: #47694
Failed build: [6742620 — azure-sdk/public]((dev.azure.com/redacted)

Diagnosis

Three distinct Pyright issues in the new RLE patch files:

  1. Tuple not imported (_patch_rle.py:195): Tuple was used in the return type annotation of _capacity_retry but not imported from typing.

  2. Attribute access on RLEInstancesOperations (both files, 14 errors): The _acquire_instance function and OpenEnvInstance/AsyncOpenEnvClient class store an instances parameter typed as RLEInstancesOperations, but call runtime methods (health, reset, step, state, get_metadata, schema) that only exist on RLEInstanceRuntimeOperations. These methods are added at runtime via setattr in RLEOperations.__init__, so Pyright cannot see them statically.

  3. str | None argument mismatch (both files): _close_group_locked passes self._version (typed Optional[str]) directly to delete_instance_group(environment_version: str).

Changes

  • _patch_rle.py: Added Tuple to the from typing import line.
  • Both files: Changed instances: RLEInstancesOperationsinstances: Any in _acquire_instance, OpenEnvInstance.__init__ / AsyncOpenEnvClient.__init__, and OpenEnvClient.__init__ / AsyncOpenEnvClient.__init__, reflecting that the object is a monkey-patched combination of both operation classes at runtime.
  • Both files: Added an early-return None guard (if self._version is None: return) in _close_group_locked before calling delete_instance_group, fixing the str | None narrowing error. This is safe because self._version is always set before any group is created (in _ensure_group).

Validation

Validation is pending the automated Pyright check triggered by the draft pull request.


Warning

Protected Files

This was originally intended as a pull request, but the patch modifies protected files. These files may affect project dependencies, CI/CD pipelines, or agent behaviour. Please review the changes carefully before creating the pull request.

Click here to create the pull request once you have reviewed the changes

Protected files
  • CHANGELOG.md

To route changes like this to a review issue instead of blocking, configure protected-files: fallback-to-issue in your workflow configuration.

Generated by Pipeline Auto Fix · 110.5 AIC · ⌖ 16.2 AIC · ⊞ 7.6K ·

  • expires on Sep 1, 2026, 1:09 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions