Skip to content

ci(lint): type-check the ADF SDK and generated schema classes in lint jobs - #21881

Open
shirshanka wants to merge 1 commit into
fix/adf-okf-mypy-with-sdk-installedfrom
ci/lint-type-check-plugin-sdks
Open

shirshanka wants to merge 1 commit into
fix/adf-okf-mypy-with-sdk-installedfrom
ci/lint-type-check-plugin-sdks

Conversation

@shirshanka

@shirshanka shirshanka commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two CI lint jobs type-check code against packages that are not installed, so mypy (with ignore_missing_imports) sees that code as Any and real type errors pass. This PR closes both gaps.

  • python-lint / :metadata-ingestion:lint: the [dev] venv did not install azure-mgmt-datafactory, so the whole Azure Data Factory source and its unit tests were checked against Any. 85 errors in adf_probe.py and tests/unit/azure_data_factory/test_adf_source.py were invisible. This adds the azure-data-factory plugin to the plugin list in base_dev_requirements, the same place every other type-checked plugin's SDK is installed.
  • smoke-test-lint / :smoke-test:pythonLint: the task did not depend on :metadata-ingestion:codegen, so datahub.metadata.schema_classes did not exist in a fresh CI checkout and every generated aspect class was Any. That hid an error in smoke-test/tests/e2e/knowledge/test_okf_reimport.py:127. pythonLint and pythonLintFix now depend on codegen, like stackFreePytest already does.

The errors themselves are fixed in #21880. This PR is stacked on #21880 so its CI stays green for review; once #21880 merges it retargets to master. On master alone, this change would turn both lint jobs red until #21880 lands.

Other plugins with the same gap

To find them, I ran mypy over metadata-ingestion with ignore_missing_imports = no in the [dev] venv and kept the imports that do not resolve. Then I installed each candidate's SDK and re-ran the normal lint to count the errors it uncovers on master:

Plugin / SDK Hidden errors today Installed size In this PR
azure-data-factory (azure-mgmt-datafactory) 85 ~5 MB yes
debug-recording (vcrpy, pyzipper, responses) 0 <1 MB yes (cheap)
montecarlo (pycarlo) 0 ~15 MB yes (cheap)
db2 (ibm_db_sa) 0 ~120 MB (bundles the IBM CLI driver) no
onnx-embeddings (onnxruntime, tokenizers) 0 ~60 MB no
sso (playwright) 0 large (bundled driver) no
memray (debug requirement) 0 ~22 MB no
sqlmesh n/a n/a no: listed in CIRCULAR_EXTRAS, cannot coexist in the lock

debug-recording and montecarlo are clean today, but their sources import their SDKs in several places, so they are added to stop the next error from hiding. The heavy ones touch one import each and are left out.

Not fixable through extras (left as is): optional imports that no extra declares (pgvector, requests_kerberos, sqllineage, google.cloud.datacatalog_lineage, black), JPype's java.util in kafka_connect, and helper scripts or integration-test setup files (pyspark, pyflink, pydeequ, pydot).

CI time cost

  • python-lint: the extra packages add ~55 MB to a cold uv cache and well under 5 s to the install (one uv pip install with a warm cache finishes in under a second). mypy with no cache took 156–165 s with the new SDKs and 156–181 s without (two runs each), so the difference is within run-to-run noise. The uv cache key already hashes setup.py/uv.lock, so the ci-cache-warmup.yml entry picks the new packages up on the next push to master.
  • smoke-test-lint: codegen now runs before lint. From a fresh worktree, ./gradlew :metadata-ingestion:codegen took 18 s with the Gradle build cache and 36 s with --no-build-cache. That covers the mxe-schemas build, a base metadata-ingestion venv and the codegen script. Expect roughly 30–60 s more on a CI runner. The job already sets up Java and Gradle caching through setup-toolchain.

Failing before, passing after

All runs use the Gradle tasks CI runs, on this branch (with the [dev] venv rebuilt from scratch):

Checklist


🤖 Opened with cclaude on behalf of @shirshanka

… jobs

python-lint's [dev] venv did not install azure-mgmt-datafactory, so mypy
(ignore_missing_imports) treated the Azure Data Factory SDK as Any and
missed type errors in the source and its tests. Add azure-data-factory to
the dev plugin list, plus the cheap debug-recording and montecarlo SDKs.

smoke-test pythonLint did not run metadata-ingestion codegen, so the
generated schema_classes were missing and also Any. Make pythonLint and
pythonLintFix depend on :metadata-ingestion:codegen.
@cclaude-datahub-project cclaude-datahub-project Bot added the cclaude Opened from a cclaude box label Dec 4, 2026
@github-actions github-actions Bot added ingestion PR or Issue related to the ingestion of metadata smoke_test Contains changes related to smoke tests labels Dec 4, 2026
@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Closes two blind spots in CI mypy where missing dependencies made imported code look like Any, so real type errors never failed the build.

For metadata-ingestion lint, the [dev] venv now pulls SDKs for plugins whose sources/tests import them but were absent from base_dev_requirements: azure-data-factory (azure-mgmt-datafactory), debug-recording (vcrpy, responses, pyzipper), and montecarlo (pycarlo). setup.py documents the rule and adds those plugins to the same plugin list used to expand dev deps; pyproject.toml and uv.lock follow the generated equivalence.

For smoke-test lint, pythonLint and pythonLintFix now depend on :metadata-ingestion:codegen (matching stackFreePytest) so generated datahub.metadata.schema_classes exists before mypy runs on smoke tests.

The actual mypy fixes are expected in a stacked PR; on master alone these changes would surface those failures until that lands.

Reviewed by Cursor Bugbot for commit eabf93a. Bugbot is set up for automated code reviews on this repo. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 74 of 859 tests in 1 batch, predicted longest batch ~1 min
  • Tags: change-type: build, pytest-plumbing, test-infra; compound: ingestion:connector
  • Confidence: HIGH (4 changed files)
  • Classifier reasoning: Adds Python dev dependencies and plugin list entries for the Azure Data Factory, Monte Carlo and debug-recording plugins plus a smoke-test Gradle codegen dependency; no product behavior changed, so change-type tags apply with no feature tags, though the new connector plugins arguably touch ingestio…
Selected scopes (19 files or classes, 74 tests)
  • tests/e2e/assertions/dbt_test_results_test.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/cli/user_groups_cmd/test_user_cmd.py
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/delete/delete_test.py
  • tests/e2e/domains/domain_entities_batching_test.py
  • tests/e2e/entity_versioning/test_versioning_ingest.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/glossary/glossary_children_count_test.py
  • tests/e2e/lineage/test_lineage_sdk.py
  • tests/e2e/managed_ingestion/ingestion_source_run_events_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/odcs/test_odcs_ingestion.py
  • tests/e2e/openapi/v3/test_scroll_entities.py
  • tests/e2e/patch/test_domain_patches.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/restli/test_restli_batch_ingestion.py
  • tests/e2e/schema_fields/test_schemafields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

commit eabf93a · workflow run

@datahub-connector-tests

Copy link
Copy Markdown

Connector Tests Results

All connector tests passed for commit eabf93a

View full test logs →

To skip connector tests, add the skip-connector-tests label (org members only).

Autogenerated by the connector-tests CI pipeline.

This branch was successfully deployed

1 active deployment
Preview — eabf93af Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cclaude Opened from a cclaude box ingestion PR or Issue related to the ingestion of metadata smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant