Skip to content

Fixes #28998: refactor(ingestion): migrate pipeline connectors (batch B) to BaseConnection#28999

Merged
IceS2 merged 3 commits into
mainfrom
refactor/baseconnection-pipeline-b
Jun 12, 2026
Merged

Fixes #28998: refactor(ingestion): migrate pipeline connectors (batch B) to BaseConnection#28999
IceS2 merged 3 commits into
mainfrom
refactor/baseconnection-pipeline-b

Conversation

@IceS2

@IceS2 IceS2 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #28998

What

Migrates the second batch of pipeline connectors onto BaseConnection[Config, Client], completing the pipeline vertical.

Connector Client type get_connection
flink FlinkClient kept module-level (a test patches it)
gluepipeline Any (boto3 glue) moved into _get_client
kafkaconnect KafkaConnectClient moved into _get_client
nifi NifiClient moved into _get_client
openlineage KafkaConsumer | BaseClient kept module-level (multi-line signature + Kafka/Kinesis dispatch helper)
spline SplineClient moved into _get_client

How

  • Each connector gains XConnection(BaseConnection[...]) with _get_client + test_connection; connection_class wired into each service_spec.py. The pipeline base source already resolves client + test_connection through metadata.ingestion.source.connections, so no source-side changes.
  • flink's existing test patches connection.get_connection, and openlineage's get_connection has a multi-line Union[KafkaConsumer, BaseClient] signature with a Kafka/Kinesis dispatch helper — both stay module-level and the class delegates.
  • gluepipeline's boto3 glue client is typed Any, matching the merged glue/sagemaker/kinesis connectors.

Tests

  • Colocated tests/unit/source/pipeline/<connector>/test_connection.py for all six (18 tests).
  • All existing pipeline topology suites pass (714).
  • basedpyright baseline check clean; ruff clean.

Note — bundled test-isolation fix

Includes the one-commit fix from #28995 (test(airflow): isolate yield_pipeline_status tests from SQLAlchemy registry pollution). This PR adds colocated test files that shift the pytest -n auto distribution; the SimpleNamespace change keeps TestYieldPipelineStatus from flaking on a poisoned shared SQLAlchemy mapper registry. Identical to #28995, so it merges cleanly whichever lands first.

IceS2 added 2 commits June 12, 2026 11:19
…nection

Migrate flink, gluepipeline, kafkaconnect, nifi, openlineage and spline
onto the BaseConnection[Config, Client] pattern and wire connection_class
into each service spec. The pipeline base source already builds its client
and runs test_connection through the generic resolver (source.connections),
so the new classes are exercised end-to-end.

flink keeps get_connection module-level because an existing test patches it;
openlineage keeps it module-level too (its get_connection has a multi-line
Union[KafkaConsumer, BaseClient] signature plus a Kafka/Kinesis dispatch
helper) — both classes delegate. gluepipeline, kafkaconnect, nifi and
spline move the build into _get_client; gluepipeline's boto3 glue client is
typed Any (matching glue/sagemaker/kinesis). Add colocated connection unit
tests for all six.
…gistry pollution

TestYieldPipelineStatus built its fake DagRun with MagicMock(spec=DagRun).
Building a spec'd mock makes unittest.mock walk dir(DagRun); DagRun's
association proxies resolve through orm.class_mapper(), which forces
SQLAlchemy to configure the entire shared mapper registry (cascade=True).

If any other test on the same xdist worker has left a mapper in a failed
state (e.g. airflow's DagWarning mapper failing to initialize), that
cascade re-raises InvalidRequestError and these two date-fallback tests
fail for reasons unrelated to what they verify. Because xdist work
distribution shifts with the test corpus, the failure surfaces on some
PRs and not others, which reads as flakiness.

Use a SimpleNamespace carrying exactly the attributes yield_pipeline_status
reads. It never introspects DagRun, so it cannot trigger mapper
configuration, and it still raises AttributeError on unexpected access.
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (12 flaky)

✅ 4292 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 299 0 2 4
🟡 Shard 2 810 0 2 9
🟡 Shard 3 807 0 5 8
🟡 Shard 4 849 0 1 12
✅ Shard 5 734 0 0 47
🟡 Shard 6 793 0 2 8
🟡 12 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Glossary - customization should work (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Preview config reflects reverted n-gram weight after save (shard 1, 2 retries)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › EditAll User: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Verify Recently Viewed widget (shard 3, 1 retry)
  • Features/McpChat.spec.ts › Clicking MCP Chat sidebar nav should navigate to chat page (shard 3, 1 retry)
  • Features/QueryEntity.spec.ts › Query Entity (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 2 retries)
  • Features/Table.spec.ts › Tags term should be consistent for search (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Enum (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tier Add, Update and Remove (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

@sonarqubecloud

Copy link
Copy Markdown

@IceS2 IceS2 merged commit 6a66cc7 into main Jun 12, 2026
61 of 63 checks passed
@IceS2 IceS2 deleted the refactor/baseconnection-pipeline-b branch June 12, 2026 14:04
@gitar-bot

gitar-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Completes the pipeline connector migration to BaseConnection and isolates airflow status tests to prevent SQLAlchemy registry pollution. 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

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.

Migrate pipeline connectors (batch B) to BaseConnection

2 participants