diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 000000000000..a06f3a72fae4 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,32 @@ +name: Copilot Setup Steps + +on: workflow_dispatch + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + cache: 'pip' + + - name: Create and activate virtual environment + run: | + python -m venv .venv + source .venv/bin/activate + echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV + echo "$(pwd)/.venv/bin" >> $GITHUB_PATH + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r eng/ci_tools.txt diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_model_base.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_model_base.py index e6a2730f9276..f46cc6a72e4b 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_model_base.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_model_base.py @@ -633,7 +633,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = getattr(cls, "__mapping__", {}).get(discriminator_value, cls) return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: