Repository navigation
fix(ingestion): silence basedpyright McpConnection flake - #27834
Merged
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
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.
jaya6400
pushed a commit
to jaya6400/OpenMetadata
that referenced
this pull request
May 4, 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.
5 of 8 tasks
pmbrull
pushed a commit
that referenced
this pull request
Aug 28, 2026
* fix(ci): restore the python pipeline on 1.13 PRs targeting 1.13 are validated by main's workflow definitions: the `pull_request_target` event resolves workflows from the default branch, while `actions/checkout` puts the 1.13 tree on disk. main's `py-tests-shared.yml` therefore runs against a checkout that is missing files it depends on, and every python job goes red regardless of the diff -- #32154, a Java-only backport, failed identically to #32166. Three gaps are fixable from this branch: * `.github/scripts/` does not exist on 1.13 at all. `classify_test_outcome.py` exits 2 *after* the tests pass (a postgres shard logged `101 passed` and `nox > Session integration-tests was successful`, then failed the job), and `configure_docker_storage.sh` exits 127, killing shards 2 and 3 before they download anything. Both scripts are copied verbatim from main; they are stdlib-only Python and plain bash with no new dependencies. The globs they read resolve here -- noxfile.py writes junit/test-results-unit.xml and junit/test-results-integration.xml. * `basedpyright~=1.39.0` floats onto 1.39.10 (released 2026-08-13), which reports ~428 errors against this branch's baseline. main pinned `==1.39.3` in #27834 to stop exactly this; only the pin is taken here, since the rest of that commit conflicts across seven files. * tests/unit/source/pipeline/openlineage/ is not a package, so its test_connection.py collides with the one under tests/unit/metadata/ingestion/connections/ and pytest intermittently reports `import file mismatch`. main disambiguates with __init__.py. Only the leaf marker is added -- enough to make the module name unique without renaming every module under tests/unit/source/. The spaCy 3.8 model mismatch and the ruff-only checkstyle install cannot be fixed from here; both need main's workflows to probe the checkout. Co-Authored-By: Claude Opus 5 <[email protected]> * test(integration): make the airflow, alationsink and ometa tests self-sufficient Backport of the test half of #32145 (2.0, c1e9302). PRs based on 1.13 are validated by main's py-tests-shared.yml, which brings the stack up with `-i false` — no openmetadata_ingestion container, so no Airflow on :8080 and no sample-data DAGs. These three suites still depended on both and failed deterministically: four alationsink cases on shard-2, three test_airflow_lineage cases plus test_es_search_from_name on shard-3, across every Python version. - airflow: a conftest that builds and runs Airflow in a testcontainer joined to ometa_network, so the suite owns its DAGs and connection. apache-airflow 3.3.0 matches this branch's setup.py, the same pin 2.0 uses. - alationsink: build the service, database, schema and tables under test instead of reading sample_data.ecommerce_db. - ometa: a test_team_data fixture creating the "Data" team that test_es_search_from_name asserts on. .dockerignore keeps the airflow image's build context to src/, and only applies to builds whose context is ingestion/ — every other image builds from the repository root with the top-level ignore file. The upstream commit's ingestion/src changes are deliberately omitted: its PLC0415 annotations and dbt/dbtcloud/vertica suppressions target 2.0's ruff and 2.0's basedpyright baseline, neither of which applies here. Its test_ometa_user_api reformatting is also dropped — only the fixture is taken, so the file stays black-conformant on this branch. Does not address shard-2's datalake failures (a 400 on recursive service delete when Airflow is absent), shard-3's trino NO_NODES_AVAILABLE errors, or test_s3_ingestion. Co-Authored-By: Claude Opus 5 <[email protected]> * test(integration): fix the trino readiness race and a stale s3 assertion trino (shard-3, 38 errors): the container readiness probe queried system.runtime.nodes, which the system connector answers on every active node before any catalog can be scheduled. The fixture proceeded and the first ANALYZE failed with NO_NODES_AVAILABLE, erroring every test in the package. Probe a real catalog instead, and replace the flat sleep(1) between write and ANALYZE with a read-back that retries while the hive split is still lagging. Pin the hive-metastore image by digest so :latest cannot drift under a maintenance branch. Only the readiness half of main's trino rework is taken. Its move of drop_stats into a reset_trino_table_statistics fixture, the folding of test_no_statistics into test_profiler, and the removal of test_empty_table_with_dropped_stats_falls_back are a coverage redesign rather than a CI fix, so this branch keeps its global drop_stats call and all three tests unchanged. Nothing in the trino connector source is touched. s3 (shard-3, 1 failed): the container payload no longer inlines children, so `assert 7 == len(bucket.children.root)` raised AttributeError. The next line already asserts the same count through list_container_children. The "Invalid STS API version" logged nearby is the non-mandatory GetMetrics step of the S3 test connection and fails nothing. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(tests): profile in setUpClass so test_list_entity_profiles has data (#31882) pytest orders unittest TestCase methods alphabetically, so test_list_entity_profiles runs first -- before test_profiler_workflow has created any profile. The module sets TestLoader.sortTestMethodsUsing = None to force definition order, but that only affects unittest's own loader: pytest collects TestCase methods itself and ignores it. Verified against an unmodified checkout -- collection still yields list_entity_profiles first with that line in place, so it has never had any effect here. The test still passed, because it asserts on a global 24h window across every table rather than on data it owns, and hard-deleted tables used to leak their profiler rows into that window. #31556 stopped that leak (issue "0 not greater than 0" on every PR that actually runs the ingestion integration matrix, blocking the merge queue. PRs that do not touch ingestion skip the matrix and report green, which is why this looked branch-specific rather than repo-wide. Run the profiler in setUpClass, where fixture data belongs, so no test depends on another's ordering. Drop the ineffective loader hack, and turn the `if profiles_all.entities:` guard into an assertion -- that guard swallowed an empty unfiltered listing and hid which of the two calls was actually empty, which is the signal needed to diagnose this. * fix(ci): stabilize remaining 1.13 Python checks * fix(ci): align 1.13 Python tests with CI --------- Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: IceS2 <[email protected]> Co-authored-by: Himanshu Khairajani <[email protected]> Co-authored-by: Pablo Takara <[email protected]>
This branch was previously deployed
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