Skip to content

fix(data-quality): pass Azure SQL connection parameters to data diff - #31057

Open
IceS2 wants to merge 5 commits into
mainfrom
rca-data-diff-issue
Open

fix(data-quality): pass Azure SQL connection parameters to data diff#31057
IceS2 wants to merge 5 commits into
mainfrom
rca-data-diff-issue

Conversation

@IceS2

@IceS2 IceS2 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #31044

Azure SQL builds its connection URL with an ODBC connection string, so
data-diff cannot read host, port, user and password from it and fails to
construct the MsSQL client.

The connection is now handed to data-diff as an explicit connection dict —
the same path Trino and Oracle already use — with the per-table database and
schema applied.

Also drops the Snowflake password from the data-diff URL when a private key is
configured, since data-diff rejects receiving both.

Azure SQL builds its connection URL with an ODBC connection string, which
keeps the credentials inside the odbc_connect query parameter where data-diff
cannot read them. Hand it an explicit connection dict instead, carrying the
per-table database and schema.

Also drop the Snowflake password from the data-diff URL when a private key is
configured, since data-diff rejects both at once.

Fixes #31044
@IceS2
IceS2 requested a review from a team as a code owner August 5, 2026 15:11
Copilot AI review requested due to automatic review settings August 5, 2026 15:11

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 5, 2026
Comment thread ingestion/src/metadata/ingestion/source/database/snowflake/data_diff/data_diff.py Outdated
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.utils.constants import THREE_MIN

DEFAULT_SQL_SERVER_PORT = 1433

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we would need that right. The connection should fail earlier in the code if the service_connection port section is null right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From what I tested, it actually could accept None and technically we could pass it and it would strip it and works (It only seems to break if we don't pass the port as it receives it as positional arg)

I like the explicit nature here and think about this more as defense in depth

IceS2 added 2 commits August 5, 2026 17:36
URL.set(password=None) leaves the password untouched, so rebuild the url
without it and assert the result through the parser data-diff itself uses.

Also resolve the connection scheme through its default so the driver name
is always set.
Copilot AI review requested due to automatic review settings August 5, 2026 15:38

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 06c94203fb7ce89936e80d2d974dbbe97a161a9c in Playwright run 31025306151, attempt 1.

✅ 107 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 55m 48s

⏱️ Max setup 3m 5s · max shard execution 10m 27s · max shard-job elapsed before upload 18m 39s · reporting 3s

🌐 208.70 requests/attempt · 1.76 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 208.7 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.76 per UI scenario (208 boots / 118 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard ingestion-01 25 0 0 0 0 0
✅ Shard ingestion-02 36 0 0 0 0 0

📦 Download artifacts

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

Copilot AI review requested due to automatic review settings August 5, 2026 16:26

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Passes Azure SQL connection parameters as an explicit dictionary and drops Snowflake passwords when using private keys, addressing the Snowflake password cleared with empty string, not removed finding.

✅ 1 resolved
Bug: Snowflake password cleared with empty string, not removed

📄 ingestion/src/metadata/ingestion/source/database/snowflake/data_diff/data_diff.py:52
To resolve the "password and private key at once" conflict the code does url.set(password=""), which renders as snowflake://user:@account/... — the authority still contains an (empty) password component. If data-diff detects a configured password with an is not None / presence check rather than a truthiness check, the conflict it rejects will still be triggered and the fix will be ineffective. The Snowflake test only re-parses the URL with SQLAlchemy (where "" is falsy) and never feeds it to data_diff.connect, so this path is unverified. Use url.set(password=None) so the password is dropped from the rendered URL entirely.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@TeddyCr
TeddyCr added this pull request to the merge queue Aug 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-05T22:51:54Z)

Blocked the queue: playwright-summary

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.

Table Diff fails for Azure SQL as secondary source with missing connection parameters

3 participants