Skip to content

Backport #32549 to 2.0: Support BigQuery STRUCT profiling - #32803

Merged
pmbrull merged 1 commit into
2.0from
pmbrull/cherry-pick-32549-to-2.0
Sep 7, 2026
Merged

pmbrull merged 1 commit into
2.0from
pmbrull/cherry-pick-32549-to-2.0

Conversation

@pmbrull

@pmbrull pmbrull commented Sep 7, 2026

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #32549 to 2.0. Original commit: 6b0d26b831df8564a4978399768e8f5dff8f61b9.

Fixes #32548 on the 2.0 line.

BigQuery STRUCT-column expansion called SQLAlchemy 1.x's Column._set_parent(parent). Under SQLAlchemy 2 that signature requires the keyword-only all_names and allow_replacements arguments, so profiling any table containing a STRUCT raised:

TypeError: Column._set_parent() missing 2 required keyword-only arguments: 'all_names' and 'allow_replacements'

_get_struct_columns now passes the required parent-registration context, and the type hint moves from dict to Iterable[tuple[str, TypeEngine[Any]]] (the actual shape of STRUCT._STRUCT_fields).

Type of change:

  • Bug fix

High-level design:

N/A — cherry-pick of a small change.

Cherry-pick notes:

One conflict, in the typing import line only — 2.0 carries from typing import List, Type, cast # noqa: UP035 where main has from typing import cast. Resolved by adding Any to the 2.0 form:

from typing import Any, List, Type, cast  # noqa: UP035

The functional hunks (Iterable/TypeEngine imports, the _set_parent call, the test) applied cleanly. The resulting diff is otherwise identical to #32549.

Tests:

Unit tests

  • Cherry-picked the regression test from Fixes #32548: Support BigQuery STRUCT profiling #32549.
  • File: ingestion/tests/unit/observability/profiler/sqlalchemy/bigquery/test_bigquery_profiler_sql.py
  • test_struct_columns_are_attached_to_the_profiled_table — asserts the flattened STRUCT leaf is attached to the profiled table. Verified RED before the fix (the exact TypeError above) and GREEN after.
  • Full BigQuery profiler suite on this branch: 7 passed.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  • ruff check + ruff format --check on both changed files — clean.
  • basedpyright on the changed source file — 0 errors, 0 warnings, 0 notes.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable.
  • For UI changes: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

Pass SQLAlchemy 2's required parent-registration context when
flattening nested BigQuery fields.

Refs #32548

(cherry picked from commit 6b0d26b)
@pmbrull
pmbrull requested a review from a team as a code owner September 7, 2026 06:10
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 Sep 7, 2026
@gitar-bot

gitar-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backport of BigQuery STRUCT profiling fix to the 2.0 branch. Updates _get_struct_columns to pass required SQLAlchemy 2 parent-registration arguments (all_names and allow_replacements) and corrects the type hint from dict to Iterable[tuple[str, TypeEngine[Any]]]. Includes the regression test from the original PR; all 7 BigQuery profiler unit tests pass. No issues found.

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 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 80290ec1228577248b2102d997917bad560a70aa in Playwright run 34089674828, attempt 1.

✅ 110 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) 49m 36s

⏱️ Max setup 3m 4s · max shard execution 11m 54s · max shard-job elapsed before upload 17m 34s · reporting 4s

🌐 207.84 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 207.84 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.79 per UI scenario (216 boots / 121 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 29 0 0 0 0 0
✅ Shard ingestion-02 35 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

@pmbrull
pmbrull merged commit 3d8a1b0 into 2.0 Sep 7, 2026
92 of 93 checks passed
@pmbrull
pmbrull deleted the pmbrull/cherry-pick-32549-to-2.0 branch September 7, 2026 07:03

This branch was previously deployed

1 inactive deployment
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.

2 participants