fix(ingestion): silence basedpyright McpConnection flake#27834
Merged
Conversation
The static-checks job intermittently fails with ~35 reportAttributeAccessIssue errors of the form "Cannot access attribute X for class McpConnection" (or CustomDriveConnection). Root cause: basedpyright's --baselinemode=discard matches baseline entries by per-file diagnostic stream order with no line numbers, so any schema regen that shifts a Union arm's narrowing cascade-misaligns downstream baseline matches and surfaces them as new errors. Defer the architectural fix and silence the flake at source: * Pin basedpyright to ==1.39.3 (was ~=1.39.0) so CI no longer pulls a different patch version with a different typeshed bundle on each run. * Add # pyright: ignore[reportAttributeAccessIssue] on the 35 access / assign sites surfaced by the failing CI run. Inline ignores delete the diagnostic from the per-file stream entirely, so they're immune to ordering shifts. reportUnnecessaryTypeIgnoreComment is already disabled in pyproject.toml, so the ignores are inert on platforms where the union narrowing collapses differently and the errors don't fire (macOS arm64). Tableau pipeline client.py library-export errors deferred to that PR's owner; unrelated to this flake.
Code Review ✅ ApprovedSilences the basedpyright McpConnection flake by adjusting the type annotation. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes ingestion static type-checking by pinning the basedpyright dev dependency and adding targeted pyright inline ignores to prevent intermittent CI failures from baseline diagnostic stream drift.
Changes:
- Pin
basedpyrightto an exact patch version (==1.39.3) in ingestion dev dependencies. - Add
# pyright: ignore[reportAttributeAccessIssue]to specific attribute access/assignment sites that intermittently surface in CI due to union-narrowing/baseline ordering drift.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ingestion/src/metadata/workflow/ingestion.py | Adds pyright ignores for supportsProfiler and custom connector class import access paths. |
| ingestion/src/metadata/utils/helpers.py | Adds pyright ignore for hostPort reassignment in the Docker-host retry helper. |
| ingestion/src/metadata/profiler/source/database/mssql/profiler_source.py | Adds pyright ignore for reading MSSQL connection scheme. |
| ingestion/src/metadata/ingestion/source/security/security_service.py | Adds pyright ignore for normalizing hostPort via clean_uri. |
| ingestion/src/metadata/ingestion/source/database/vertica/query_parser.py | Adds pyright ignores for reading/mutating database during multi-db iteration. |
| ingestion/src/metadata/ingestion/source/database/vertica/metadata.py | Adds pyright ignore for reading configured database. |
| ingestion/src/metadata/ingestion/source/database/timescale/query_parser.py | Adds pyright ignores for reading/mutating database during multi-db iteration. |
| ingestion/src/metadata/ingestion/source/database/snowflake/metadata.py | Adds pyright ignore for reading configured database. |
| ingestion/src/metadata/ingestion/source/database/redshift/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/postgres/query_parser.py | Adds pyright ignores for reading/mutating database during multi-db iteration. |
| ingestion/src/metadata/ingestion/source/database/postgres/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/mssql/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/microsoftfabric/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/greenplum/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/cockroach/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/database/azuresql/metadata.py | Adds pyright ignores for ingestAllDatabases / database access in get_database_names. |
| ingestion/src/metadata/ingestion/source/dashboard/tableau/metadata.py | Adds pyright ignores for proxyURL access when building base URL. |
| ingestion/src/metadata/ingestion/source/dashboard/quicksight/metadata.py | Adds pyright ignore for nested awsConfig.awsRegion access. |
| ingestion/src/metadata/ingestion/source/dashboard/mode/metadata.py | Adds pyright ignores for workspaceName / filterQueryParam access. |
| ingestion/src/metadata/ingestion/source/api/rest/metadata.py | Adds pyright ignores for OpenAPI connection/doc URL attribute access. |
| ingestion/src/metadata/automations/runner.py | Adds pyright ignore for hostPort reassignment in docker-host fallback. |
| ingestion/setup.py | Pins basedpyright to ==1.39.3 in the dev dependency set. |
|
Contributor
🟡 Playwright Results — all passed (11 flaky)✅ 3987 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 86 skipped
🟡 11 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
pmbrull
approved these changes
Apr 30, 2026
mohitjeswani01
pushed a commit
to mohitjeswani01/OpenMetadata
that referenced
this pull request
Apr 30, 2026
…ake (open-metadata#27834) The static-checks job intermittently fails with ~35 reportAttributeAccessIssue errors of the form "Cannot access attribute X for class McpConnection" (or CustomDriveConnection). Root cause: basedpyright's --baselinemode=discard matches baseline entries by per-file diagnostic stream order with no line numbers, so any schema regen that shifts a Union arm's narrowing cascade-misaligns downstream baseline matches and surfaces them as new errors. Defer the architectural fix and silence the flake at source: * Pin basedpyright to ==1.39.3 (was ~=1.39.0) so CI no longer pulls a different patch version with a different typeshed bundle on each run. * Add # pyright: ignore[reportAttributeAccessIssue] on the 35 access / assign sites surfaced by the failing CI run. Inline ignores delete the diagnostic from the per-file stream entirely, so they're immune to ordering shifts. reportUnnecessaryTypeIgnoreComment is already disabled in pyproject.toml, so the ignores are inert on platforms where the union narrowing collapses differently and the errors don't fire (macOS arm64). Tableau pipeline client.py library-export errors deferred to that PR's owner; unrelated to this flake.
jatinmasaram
pushed a commit
to jatinmasaram/OpenMetadata
that referenced
this pull request
May 2, 2026
…ake (open-metadata#27834) The static-checks job intermittently fails with ~35 reportAttributeAccessIssue errors of the form "Cannot access attribute X for class McpConnection" (or CustomDriveConnection). Root cause: basedpyright's --baselinemode=discard matches baseline entries by per-file diagnostic stream order with no line numbers, so any schema regen that shifts a Union arm's narrowing cascade-misaligns downstream baseline matches and surfaces them as new errors. Defer the architectural fix and silence the flake at source: * Pin basedpyright to ==1.39.3 (was ~=1.39.0) so CI no longer pulls a different patch version with a different typeshed bundle on each run. * Add # pyright: ignore[reportAttributeAccessIssue] on the 35 access / assign sites surfaced by the failing CI run. Inline ignores delete the diagnostic from the per-file stream entirely, so they're immune to ordering shifts. reportUnnecessaryTypeIgnoreComment is already disabled in pyproject.toml, so the ignores are inert on platforms where the union narrowing collapses differently and the errors don't fire (macOS arm64). Tableau pipeline client.py library-export errors deferred to that PR's owner; unrelated to this flake.
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.


Summary
basedpyright==1.39.3(was~=1.39.0) to remove patch-version / typeshed drift as a future flake source.# pyright: ignore[reportAttributeAccessIssue]on 35 access / assign sites surfaced by the failing CI run; deletes the diagnostics from each per-file stream so the baseline can no longer drift them.Why
CI's
Run Static Checksstep intermittently fails with ~35reportAttributeAccessIssueerrors of the formCannot access attribute X for class "McpConnection"(orCustomDriveConnection). The errors are not new code — the underlying type holes have always been there — butbasedpyright's--baselinemode=discardmatches baseline entries by per-file diagnostic stream order with no line numbers, so any schema regen that shifts a Union arm's narrowing cascade-misaligns downstream baseline matches and surfaces them as new errors.Inline ignores are position-stable: they delete the diagnostic from the stream entirely, so they survive future Union ordering shifts. The proper architectural fix (class-level
service_connection: <X>Connectionnarrowing on each connector source class, plus long-path →self.service_connectionrefactors) is deferred — when narrowing succeeds, it exposes a second-order cascade of pre-existing Optional-chain issues that need their own audit.reportUnnecessaryTypeIgnoreCommentis already disabled inpyproject.toml(per the existing comment about cross-platform stub drift), so the ignores are inert on platforms where the union narrowing collapses differently and the errors don't fire (macOS arm64).The 3
tableauserverclientlibrary-export errors atpipeline/tableaupipeline/client.py:19,21,22are a separate, unrelated issue (third-party packaging bug); deferred to that PR's owner.Test plan
ruff checkcleanruff format --checkclean (zero file changes from format pass)basedpyright --baselinefile .basedpyright/baseline.json --baselinemode=discard --pythonplatform Linuxproduces an identical 62-error set before and after the changes — zero new errors introducedbasedpyrightwithout baseline reports 0 mentions offor class "McpConnection"orfor class "CustomDriveConnection"on Linux + Darwin platformsRun Static Checks (3.10)job passes on this PR