Fix pyright 1.1.407 typing errors in azure-health-deidentification#46742
Draft
Fix pyright 1.1.407 typing errors in azure-health-deidentification#46742
Conversation
Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/34a2c7e8-1f46-455a-85c0-cbf28e9d08ae Co-authored-by: azure-sdk <53356347+azure-sdk@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update typing for azure-health-deidentification for pyright 1.1.407
Fix pyright 1.1.407 typing errors in azure-health-deidentification
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pyright 1.1.407 tightened inference on
dict.get(key, default)— when the default isdata.__class__, it now inferstype | Noneinstead oftype, causingissubclass(enum_type, Enum)to fail type checking.Changes
_serialization.py/_utils/serialization.py: Wrap thedict.getdefault withcast(type, ...)so pyright resolvesenum_typeastype.Consistent with the fix already applied in other SDK packages (e.g.,
azure-mgmt-containerservice).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
centralus-2.in.applicationinsights.azure.com/home/REDACTED/bin/azsdk /home/REDACTED/bin/azsdk ingest-telemetry --client-type copilot-cli --event-type skill_invocation --session-id 34a2c7e8-1f46-455a-85c0-cbf28e9d08ae --skill-name find-package-skill(dns block)pypi.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.10/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-i8idps88/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=42 wheel(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.10/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-s1531cce/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=40.8.0(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/lib/python3.10/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-936g67jq/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED -- setuptools>=40.8.0(dns block)pypi.python.org/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python -m pip install pyright==1.1.407(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/lib/python3.10/site-packages/pip/__pip-REDACTED__.py install --ignore-installed --no-user --prefix /tmp/pip-build-env-fq9cwd68/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i REDACTED --extra-index-url REDACTED -- setuptools>=40.8.0 wheel(dns block)/home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/bin/python -m pip install /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/.staging/azure_health_deidentification-1.1.0b1.tar.gz /home/REDACTED/work/azure-sdk-for-python/azure-sdk-for-python/.venv/azure-health-deidentification/.venv_next-pyright/.staging/dl/azure_core-1.40.0-py3-none-any.whl(dns block)scanning-api.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: