Repository navigation
Backport #32549 to 2.0: Support BigQuery STRUCT profiling - #32803
Conversation
❌ PR checklist incompleteThis 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 |
Code Review ✅ ApprovedBackport of BigQuery STRUCT profiling fix to the 2.0 branch. Updates OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



Describe your changes:
Backport of #32549 to
2.0. Original commit:6b0d26b831df8564a4978399768e8f5dff8f61b9.Fixes #32548 on the
2.0line.BigQuery STRUCT-column expansion called SQLAlchemy 1.x's
Column._set_parent(parent). Under SQLAlchemy 2 that signature requires the keyword-onlyall_namesandallow_replacementsarguments, so profiling any table containing a STRUCT raised:_get_struct_columnsnow passes the required parent-registration context, and the type hint moves fromdicttoIterable[tuple[str, TypeEngine[Any]]](the actual shape ofSTRUCT._STRUCT_fields).Type of change:
High-level design:
N/A — cherry-pick of a small change.
Cherry-pick notes:
One conflict, in the
typingimport line only —2.0carriesfrom typing import List, Type, cast # noqa: UP035wheremainhasfrom typing import cast. Resolved by addingAnyto the2.0form:The functional hunks (
Iterable/TypeEngineimports, the_set_parentcall, the test) applied cleanly. The resulting diff is otherwise identical to #32549.Tests:
Unit tests
ingestion/tests/unit/observability/profiler/sqlalchemy/bigquery/test_bigquery_profiler_sql.pytest_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 exactTypeErrorabove) and GREEN after.Backend integration tests
Ingestion integration tests
main(92/92 STRUCT tables profiled, 184 profiler records, zero errors). The code here is byte-identical apart from the import line.Playwright (UI) tests
Manual testing performed
ruff check+ruff format --checkon both changed files — clean.basedpyrighton the changed source file —0 errors, 0 warnings, 0 notes.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.