Skip to content

fix(ingestion): silence basedpyright McpConnection flake#27834

Merged
pmbrull merged 1 commit intomainfrom
fix/basedpyright-mcpconnection-flake
Apr 30, 2026
Merged

fix(ingestion): silence basedpyright McpConnection flake#27834
pmbrull merged 1 commit intomainfrom
fix/basedpyright-mcpconnection-flake

Conversation

@IceS2
Copy link
Copy Markdown
Contributor

@IceS2 IceS2 commented Apr 29, 2026

Summary

  • Pin basedpyright==1.39.3 (was ~=1.39.0) to remove patch-version / typeshed drift as a future flake source.
  • Add # 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 Checks step intermittently fails with ~35 reportAttributeAccessIssue errors of the form Cannot access attribute X for class "McpConnection" (or CustomDriveConnection). The errors are not new code — the underlying type holes have always been there — but 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.

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>Connection narrowing on each connector source class, plus long-path → self.service_connection refactors) is deferred — when narrowing succeeds, it exposes a second-order cascade of pre-existing Optional-chain issues that need their own audit.

reportUnnecessaryTypeIgnoreComment is already disabled in pyproject.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 tableauserverclient library-export errors at pipeline/tableaupipeline/client.py:19,21,22 are a separate, unrelated issue (third-party packaging bug); deferred to that PR's owner.

Test plan

  • ruff check clean
  • ruff format --check clean (zero file changes from format pass)
  • basedpyright --baselinefile .basedpyright/baseline.json --baselinemode=discard --pythonplatform Linux produces an identical 62-error set before and after the changes — zero new errors introduced
  • basedpyright without baseline reports 0 mentions of for class "McpConnection" or for class "CustomDriveConnection" on Linux + Darwin platforms
  • CI's Run Static Checks (3.10) job passes on this PR

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.
Copilot AI review requested due to automatic review settings April 29, 2026 19:30
@IceS2 IceS2 requested a review from a team as a code owner April 29, 2026 19:30
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Apr 29, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 29, 2026

Code Review ✅ Approved

Silences the basedpyright McpConnection flake by adjusting the type annotation. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 basedpyright to 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.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'open-metadata-ingestion'

Failed conditions
40.0% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (11 flaky)

✅ 3987 passed · ❌ 0 failed · 🟡 11 flaky · ⏭️ 86 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 297 0 2 4
🟡 Shard 2 751 0 3 8
🟡 Shard 3 745 0 1 7
🟡 Shard 4 774 0 1 18
✅ Shard 5 687 0 0 41
🟡 Shard 6 733 0 4 8
🟡 11 flaky test(s) (passed on retry)
  • Pages/AuditLogs.spec.ts › should apply both User and EntityType filters simultaneously (shard 1, 1 retry)
  • Pages/Bots.spec.ts › Bots Page should work properly (shard 1, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event is created when description is updated (shard 2, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/BulkImport.spec.ts › Table (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Pages/DataProductAndSubdomains.spec.ts › Add assets to data product and verify count (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@pmbrull pmbrull merged commit 4bb3573 into main Apr 30, 2026
52 of 53 checks passed
@pmbrull pmbrull deleted the fix/basedpyright-mcpconnection-flake branch April 30, 2026 05:35
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants