Repository navigation
audit: document compaction_windows partition limitation in SDK.md (nightly) - #502
Conversation
…ghtly) The 0.5.4 CHANGELOG (GoogleCloudPlatform#501) records a known limitation of the compaction_windows view (GoogleCloudPlatform#494): it exposes no event `timestamp` column, so a query through it reads every partition of the events table and fails on a table that sets `require_partition_filter`. SDK.md's compaction_windows section, the view's reference doc, did not say so. Add the limitation to SDK.md, with a pointer to the adk_event_compactions per-event view for time-bounded queries. A new test ties the note to the view: it fails while the view has no `timestamp` column and SDK.md omits the limitation, and it fails once a `timestamp` column is added, so the note goes away with that fix.
caohy1988
left a comment
There was a problem hiding this comment.
Blind independent review of head c3c5cc8 against main 1304d5b.
Rejection criteria (written before reading the diff):
- The limitation or time-bounded-query pointer contradicts the view SQL, partition design, or changelog.
- The new test passes without the documentation change, is vacuous, or relies too heavily on incidental wording.
- Scope, test, formatting, CI, or PR proof claims fail verification.
What I tried:
- Read the PR description and full base-to-head diff. Only SDK.md and tests/test_compaction_windows.py changed; no version/release-note changes or tracked intent.md/spec.md/plan.md files.
- Checked src/bigquery_agent_analytics/views.py:338-377: the compaction view neither selects nor filters the event timestamp. Checked docs/design.md:1108 (PARTITION BY DATE(timestamp)) and CHANGELOG.md:38-41. SDK.md:1476-1480 agrees with these sources. Generated get_view_sql("EVENT_COMPACTION") independently and asserted both the adk_event_compactions name and the timestamp header. The pointer is correct for event-timestamp-bounded queries. No live BigQuery query was run.
- Created an independent editable-install Python 3.12.9 environment in this worktree. Latest cryptography failed to build locally; installed with cryptography<49 (48.0.1) instead.
- Ran python -m pytest tests/test_compaction_windows.py tests/test_views.py -q: 81 passed, 1 skipped. Also reran the PR's three-file command including tests/test_pr16_fixes.py: 135 passed, 1 skipped. The skipped test is the opt-in live BigQuery contract.
- Replaced SDK.md temporarily with the exact base version: the new test failed at line 276, with 1 failed and 55 deselected. Replaced it with base plus an unrelated HTML comment containing the checked token: the same test passed, with 1 passed and 55 deselected. Restored SDK.md byte-for-byte afterward.
- pyink 25.12.0 --check and isort 9.0.2 --check-only passed on the changed Python file; Markdown is not a Python formatter input. Also reran the PR's full formatter paths: pyink reported 366 files unchanged and isort passed. git diff --check passed.
- gh pr checks: all applicable checks passed, including Format, Build, browser smoke, Python 3.10-3.14, scan-pr, check-changes and CLA; conditional zizmor jobs skipped. Confirmed the PR head still matches the reviewed SHA. Final git status shows no tracked changes.
Findings:
P0: None.
P1 — The doc-sync assertion can pass with the limitation entirely missing (tests/test_compaction_windows.py:274-276).
The assertion searches all of SDK.md for one literal token, without tying it to compaction_windows or checking any stated limitation. Concrete disproof: use base SDK.md (which contains no new paragraph) and append only <!-- unrelated example: require_partition_filter -->; test_partition_limitation_is_documented passes. Thus the test can remain green when the required paragraph is removed, relocated to an unrelated feature, or reversed in meaning. The SQL projection assertion does not validate the documentation. This meets rejection criterion 2 and the contract's requirement that the doc-sync test not be vacuous.
Suggested fix: bound the documentation check to the compaction_windows discussion and check stable substantive markers for the absent event timestamp, lack of partition pruning, require_partition_filter failure, and the adk_event_compactions pointer, without matching the entire paragraph verbatim. Verify that removing the limitation paragraph still fails even when the token exists elsewhere in SDK.md.
P2: None.
No peer reviews or review/issue comments were read. The red/green counts and formatter claims reproduced; the requested non-vacuous documentation guard did not survive the adversarial probe.
VERDICT: REQUEST_CHANGES @ c3c5cc8
caohy1988
left a comment
There was a problem hiding this comment.
Blind disproof review by Fable (Claude), on behalf of @caohy1988. Head c3c5cc84d93e0518081723a77bf0a490e00547cd, base 1304d5bff2cf. I read only the PR description, the diff, the repo files and CI. I did not read any other review or comment on this PR before posting.
Rejection criteria (written before reading the diff)
- R1 (truth): the new "Known limitation" text says something false about the code (the
compaction_windowsSELECT list, orget_view_sqlforEVENT_COMPACTION, which buildsadk_event_compactions), contradicts thedocs/design.mdpartitioning or CHANGELOG 0.5.4, or points time-bounded queries somewhere that doesn't work. - R2 (test quality):
test_partition_limitation_is_documented(a) passes on base SDK.md, (b) is vacuous: its assertion is satisfied by text elsewhere in SDK.md, or it isn't scoped to the compaction_windows section, or (c) is brittle: harmless rewording, whitespace or wrapping breaks it while the limitation is still documented. - R3 (scope and proof): the diff touches anything besides
SDK.mdandtests/test_compaction_windows.py, CI is red on the head SHA, or a proof claim in the PR body doesn't reproduce.
Outcome: R1 and R3 are not met. R2(b) is met. The doc assertion reads the whole of SDK.md, so it still passes with the compaction_windows note deleted, as long as require_partition_filter appears anywhere else in the file (mutation M2 below). The doc text itself is accurate.
What I tried
R1: the note against the code
src/bigquery_agent_analytics/views.py:361-369: the finalSELECT DISTINCTprojects onlyapp_name, user_id, session_id, invocation_id, start_ts, end_ts, start_seconds, end_seconds. The only base-table scan (views.py:348-349) filters onevent_typealone. I renderedget_view_sql("compaction_windows")to confirm. So no query through the view can put a predicate on the partitioning column.docs/design.md:1108-1109:PARTITION BY DATE(timestamp),CLUSTER BY event_type, agent, user_id. "Reads every partition … (no partition pruning)" is right. It's consistent with, and a bit more precise than,CHANGELOG.md:38-41("scans the whole events table"), because clustering onevent_typecan still prune blocks inside each partition.- Pointer:
get_view_sql("EVENT_COMPACTION")renders`p.d.adk_event_compactions`as_STANDARD_HEADERS(views.py:59-60, first columntimestamp) plus the typed columns,FROM <table> WHERE event_type = 'EVENT_COMPACTION'(views.py:386-391). It's a plain projection, so atimestamppredicate on it reaches the partition column. Correct. - The
require_partition_filterfailure follows from the first bullet. I did not live-probe it (no cloud resources); the PR body says the same.
R3: proof claims, all reproduced in a fresh gitignored .venv (CPython 3.12.9, pyink 25.12.0, isort 9.0.2, pytest 9.1.1):
python -m pytest tests/test_compaction_windows.py tests/test_views.py -q:81 passed, 1 skipped. The skip is the opt-in live BigQuery probe (BQAA_LIVE_BQ).- The PR body's three-file run gives
135 passed, 1 skipped, and-k partition_limitationgives1 passed, 55 deselected, both as claimed. - Red-before: with base
SDK.mdswapped in,1 failed, 55 deselectedattests/test_compaction_windows.py:276, the SDK.md assert, so the line-273 assert passed. File restored afterwards. pyink --check --config pyproject.toml src/ tests/ examples/ scripts/ dashboards/:366 files would be left unchanged, rc=0.isort --check-onlyover the same dirs and on the changed file: rc=0.git diff --check: clean. No trackedintent.md/plan.md/spec.md.- The PR body's
git grepon base reproduces: onlydocs/otlp_receiver_design.md:109,materialize_window.py:749andtests/test_materialize_window.py:518. - Scope:
git diff --name-statuslists only the two files. No src,pyproject.tomlor CHANGELOG change. - CI on
c3c5cc8(run 36701550388) is all green. On every Test job (3.10-3.14), pytest totals went from5279 passed, 81 skippedon base main (run 36607158452) to5280 passed, 81 skipped, so the new test ran and passed on every interpreter.
R2: break attempts (in-place mutations, each restored; tracked tree clean at the end):
| Mutation | New test | Meaning |
|---|---|---|
M2: base SDK.md (note absent) plus one unrelated sentence mentioning `require_partition_filter` under ## 16. |
passes | the guard is satisfied without the compaction_windows note |
| M3: note kept, backticks dropped from the option name | fails | coupled to Markdown formatting |
M3b: note kept, reworded to `require_partition_filter = TRUE` |
fails | same |
| M4: note reflowed onto one line | passes | robust to wrapping |
M5: view gains timestamp, fixture not updated |
fails (sqlite3.OperationalError) |
tripwire fires |
M5a: full fix exposing timestamp (fixture updated) |
fails at "timestamp" not in row |
the PR body's tripwire claim holds |
M5b: full fix exposing event_timestamp instead |
passes; only test_fractional_window_survives_conversion fails |
tripwire only matches the literal name |
Findings
P0: none.
P1: the doc guard isn't scoped to the section it protects (tests/test_compaction_windows.py:274-276, meets R2(b)). "`require_partition_filter`" in f.read() searches all 2,700 lines of SDK.md. M2 shows the test passing with the compaction_windows note deleted as soon as the option name appears anywhere else. That's plausible: materialize_window.py:749 and docs/otlp_receiver_design.md:109 already deal with partition filters and are natural future SDK.md topics. The whole-file checks in tests/test_pr16_fixes.py:561-570 are fine because they assert file-wide properties; this one asserts something about one section. Suggested replacement for lines 275-276:
with open(sdk_md, encoding="utf-8") as f:
doc = f.read()
start = doc.index("#### Cross-event views")
section = doc[start : doc.index("\n## ", start)]
assert "require_partition_filter" in sectionI tested this: pyink and isort are clean; it passes on head, fails on base SDK.md and on M2, and passes on M3/M3b (dropping the backticks removes the Markdown coupling). The whole file gives 55 passed, 1 skipped. A renamed heading fails loudly (ValueError), which is the right behavior for a doc-sync test.
P2 (optional, non-blocking):
- The
"timestamp" not in rowtripwire (:273) only fires for a column named exactlytimestamp(M5b).test_fractional_window_survives_conversionalready pins the exact row, so a renamed column still fails something. But the PR body's "the note is removed along with that fix" depends on the column name. - The
adk_event_compactionspointer (SDK.md:1478-1480) is correct but isn't a drop-in replacement. That view hasagent, notapp_name, returns one row per event (no dedupe), and converts with plainCAST/TIMESTAMP_MICROS(views.py:265-270). Under BigQuery cast semantics (not live-probed), a non-numeric, non-finite or out-of-range boundary in the scanned range can fail a query thatcompaction_windowswould have skipped. Consider a clause such as "filter on itstimestamp; it does not deduplicate or skip malformed boundaries".
Not verified: live BigQuery behavior against a require_partition_filter table. I created no cloud resources; the conclusion is from the view SQL and documented BigQuery semantics.
VERDICT: REQUEST_CHANGES @ c3c5cc8
Review of c3c5cc8 found that test_partition_limitation_is_documented searched all of SDK.md for `require_partition_filter`. The test still passed after the limitation paragraph was deleted, as long as the token appeared anywhere else in the file. Scope the search to the "Cross-event views" section, and require one paragraph there to name both `require_partition_filter` and the `adk_event_compactions` pointer. A renamed heading now raises ValueError instead of widening the search. SDK.md now also says that `adk_event_compactions` is not a drop-in replacement: it does not deduplicate windows or skip malformed boundaries, and it has `agent` rather than `app_name`.
caohy1988
left a comment
There was a problem hiding this comment.
Blind independent round-2 review of a64e469.
Rejection criteria (declared before inspecting the diff):
- The limitation or per-event pointer contradicts views.py, the partition design, or CHANGELOG.md.
- The scoped documentation test misses a required mutation, remains vacuous about the limitation, or fails on trivial paragraph rewording.
- Scope, tests, formatting, CI, or proof claims fail the contract.
What I tried:
- Read only the PR description and my own round-1 review 5364968093. No peer reviews, other comments, vault files, implementer worktree, or peer result files were read.
- Read both requested diffs: round-1-to-head and base 1304d5b-to-head. Both change only SDK.md and tests/test_compaction_windows.py. No version bump or new intent/spec/plan files.
- Checked views.py:60-72,260-272,338-377 and docs/design.md:1108 against CHANGELOG.md:38-41 and SDK.md:1476-1482. The compaction view neither exposes nor filters the partition timestamp. Independently generated EVENT_COMPACTION SQL with PYTHONPATH=src: adk_event_compactions includes timestamp and agent, lacks app_name and DISTINCT, and uses unsafe boundary conversions with no malformed-boundary exclusion predicates. All added pointer qualifications are accurate. No live BigQuery query was run.
- Reused this worktree's .venv-astra (Python 3.12.9). Requested two-file pytest run: 81 passed, 1 skipped. Reproduced the PR's three-file run: 135 passed, 1 skipped. The skip is the opt-in live BigQuery contract.
- Mutation probes, each running the actual partition_limitation test: removed the paragraph and appended an unrelated sentence containing both tokens elsewhere in SDK.md => FAIL at test line 281; renamed the Cross-event views heading => FAIL at line 279; removed the pointer from the limitation paragraph => FAIL at line 281. Each produced 1 failed, 55 deselected.
- Trivial paragraph rewording (Known limitation -> Current constraint; reads every partition -> scans all partitions; rephrased time-bounded queries) => PASS, 1 passed, 55 deselected.
- Two further disproof probes: replaced the entire limitation paragraph with a token-only references sentence => PASS; replaced it with a false claim that partition pruning works and require_partition_filter succeeds => PASS. Details below.
- pyink 25.12.0 (<26) and isort --check-only passed on the changed Python file. Reproduced full PR formatter commands: pyink reported 366 files unchanged (notebooks skipped without Jupyter dependencies); isort passed. git diff --check passed.
- gh pr checks: all applicable checks passed; conditional zizmor jobs skipped. Independently confirmed Actions runs 36704676575, 36704669670, and 36704676541 completed successfully on the exact reviewed SHA. Rechecked current PR head. SDK.md was restored byte-for-byte; final git status has no tracked changes.
Findings:
P0: None.
P1 — The round-1 substantive documentation guard remains vacuous (tests/test_compaction_windows.py:281-285).
The scoped assertion requires only two tokens in the same paragraph; it does not check any limitation. Replace SDK.md:1476-1482 with either of these paragraphs and the actual test passes (1 passed, 55 deselected):
Related references: require_partition_filter and adk_event_compactions.
The view supports partition pruning and succeeds with require_partition_filter; adk_event_compactions is also available.
Thus all documentation of the limitation can disappear, or its meaning can be reversed, while this test stays green. The exact outside-section bypass from round 1 is fixed, but rejection criterion 2 is still met: the test's claim that the section must document the limitation is not enforced. Check stable substantive markers for the missing event timestamp, absence of pruning, partition-filter failure, and the pointer within the relevant discussion, without matching the whole paragraph verbatim. Keep the successful required negative probes and rewording probe, and add a token-only paragraph deletion probe.
P2: None.
The PR body still describes the original global-token assertion and original line range; its historical red/green counts reproduced, and the new commit accurately describes the narrower token check. Documentation and CI are otherwise consistent with the contract.
VERDICT: REQUEST_CHANGES @ a64e469
caohy1988
left a comment
There was a problem hiding this comment.
Blind round-2 disproof review by Fable (Claude), on behalf of @caohy1988. Head a64e469d8719745c3499bf6f72e6072def3ba093, round-1 head c3c5cc8, base 1304d5b. I read the PR description, both diffs (c3c5cc8..a64e469 and 1304d5b..a64e469), the repo files, CI, and only my own round-1 review (5365064758). I did not read any other review or comment on this PR.
Rejection criteria (written before reading the new diff)
- R1 (truth): some clause of the SDK.md "Known limitation" paragraph is false against
src/bigquery_agent_analytics/views.pyor contradicts CHANGELOG 0.5.4. This includes the new "not a drop-in replacement" clause (no deduplication, no skipping of malformed boundaries,agentrather thanapp_name). It is also met if theadk_event_compactionspointer doesn't work for time-bounded queries. - R2 (round-1 blocker): the scoped
test_partition_limitation_is_documentedfails on head, or it still passes once the note is deleted or separated from its pointer (paragraph removed and the tokens planted elsewhere in SDK.md, heading renamed, pointer removed), or a trivial rewording that keeps the meaning breaks it. - R3 (scope and proof): changes outside
SDK.mdandtests/test_compaction_windows.py(against round 1 or base), a version bump or intent/spec/plan files, CI not green ona64e469, or a PR-body or commit claim that doesn't reproduce.
Outcome: none of R1-R3 is met, and the round-1 P1 is fixed. The exact round-1 M2 repro now fails.
What I tried
R2: attempts to break the scoped test. Each probe writes a mutated SDK.md and the test file into a throwaway /tmp directory and runs -k partition_limitation against head src/. No tracked file was touched. Every probe ran against both the round-2 test and, for comparison, the round-1 test.
| Probe | round-2 test | round-1 test |
|---|---|---|
| head SDK.md (control) | pass | pass |
| base SDK.md (no note) | fail | fail |
exact round-1 M2: base SDK.md plus an unrelated `require_partition_filter` sentence under ## 16. |
fail | pass |
| limitation paragraph deleted | fail | fail |
paragraph deleted, plus one paragraph naming both tokens placed under ## 16., before the heading (in #### ADK 2.0 event types), or at end of file |
fail ×3 | pass ×3 |
paragraph deleted, plus require_partition_filter in a different in-section paragraph (the adjacent paragraph still names adk_event_compactions) |
fail | pass |
heading renamed to #### Cross-event analytical views, or promoted to ### |
fail (ValueError, :279) |
pass |
heading renamed, paragraph deleted, both tokens placed under ## 16. |
fail (ValueError, so the search does not widen) |
pass |
heading suffixed: #### Cross-event views (ADK 2.0) |
pass | pass |
pointer sentence removed (the adjacent paragraph at SDK.md:1469-1474 still names adk_event_compactions) |
fail | pass |
| pointer replaced by "filter the events table directly" | fail | pass |
backticks dropped from both tokens, or `require_partition_filter = TRUE` |
pass | fail |
| reflowed onto one line, re-wrapped at 58 columns, fully reworded with the tokens kept, whole file converted to CRLF, or turned into a tight two-item bullet list | pass | pass |
| paragraph split in two (blank line before the pointer) | fail | pass |
pointer written as `<view_prefix>event_compactions` |
fail | pass |
pointer removed and the paragraph merged into the one before it (which names adk_event_compactions) |
pass | pass |
Every probe that deletes the note or its pointer, or moves them apart, now fails. A renamed heading fails loudly instead of widening the search. Rewordings that keep the meaning still pass, and the check is less tied to formatting than round 1 was: backticks and = TRUE no longer break it. The split-paragraph and prefixed-name probes fail by design, because the test requires both tokens in one paragraph and pins the default view name; both failures are loud, which I think is acceptable. The last row passes: that is the limit of any token check, and it takes two deliberate edits, so it is not blocking.
I also checked the slice itself. It covers SDK.md:1420-1511 (it ends at ## 16.), and exactly one paragraph in it names both tokens: the new SDK.md:1476-1481. Ending the slice at the next "\n## " is coarse but correct here. The section's code fences contain # ... comment lines (SDK.md:1430, 1440, 1443), so ending it at "the next heading of any level" would cut the slice before the note.
R1: the wording against the code. I rendered get_view_sql("EVENT_COMPACTION") and get_view_sql("compaction_windows") at head; src/ has no diff against base.
- "keeps the
timestampheader": true._STANDARD_HEADERS(views.py:59-71) starts withtimestamp. The renderedadk_event_compactionsis a plain projection,FROM <table> WHERE event_type = 'EVENT_COMPACTION'(views.py:386-392), so atimestamppredicate reaches the partition column (docs/design.md:1108). - "does not deduplicate windows": true. The rendered per-event SQL has no
DISTINCT;compaction_windowsusesSELECT DISTINCT(views.py:361). - "or skip malformed boundaries": true. The per-event columns are plain
CAST/TIMESTAMP_MICROS(views.py:265-270), with noSAFEfunction, and the only predicate is onevent_type.compaction_windowsusesSAFE_CAST/SAFE_MULTIPLY/SAFE.TIMESTAMP_MICROSand filters bad boundaries (views.py:340-377). The wording understates the effect rather than misstating it. Under documented BigQuery cast semantics (not live-probed), a non-numeric, non-finite or out-of-range boundary makes the query fail instead of returning a row. The preceding paragraph's "excluded without failing the query" (SDK.md:1470-1471) already implies that contrast. - "has
agentrather thanapp_name": true. The rendered SQL hasagentand noapp_name. It also has noattributescolumn, soapp_namecan't be recovered through this view. - The first sentence is unchanged since round 1. It still matches
CHANGELOG.md:38-41and thecompaction_windowsselect list (views.py:361-369), which has notimestamp.
R3: scope and proof.
git diff --name-statusfor bothc3c5cc8..a64e469and1304d5b..a64e469lists onlySDK.mdandtests/test_compaction_windows.py. The round-1 → round-2 change is the new clause (SDK.md:1480-1481) plus the test scoping.src/,pyproject.tomlandCHANGELOG.mdhave no diff lines. Nointent.md/plan.md/spec.mdis tracked.git diff --checkis clean.- Local runs used the existing gitignored worktree
.venv(CPython 3.12.9, pytest 9.1.1):python -m pytest tests/test_compaction_windows.py tests/test_views.py -q:81 passed, 1 skipped. The skip is the opt-inBQAA_LIVE_BQprobe.-k partition_limitation:1 passed, 55 deselected.- The PR body's three-file run:
135 passed, 1 skipped.
- Format: pyink 25.12.0 (CI pins
<26) with--check --config pyproject.tomlleaves the changed file unchanged, and over the CI scope reports366 files would be left unchanged, rc=0. isort 9.0.2--check-onlyon the changed file and on the CI scope: rc=0. - CI on
a64e469(run 36704676575): Format check, Build package, Configurator browser smoke and Test 3.10-3.14 all pass, as do scan-pr, cla/google and check-changes. The four zizmor jobs are skipped because check-changes runs them only when.github/workflows/*.ymlordependabot.ymlchange, and this PR changes neither. Every Test job reports5280 passed, 81 skipped, against5279 passed, 81 skippedon base main (run 36607158452 at1304d5b). So the modified test ran and passed on every interpreter. - The
a64e469commit message holds up claim by claim. The round-1 M2 repro now fails, a renamed heading raisesValueError, one paragraph must name both tokens, and the new SDK.md clause is present. The PR body's citationsCHANGELOG.md:38,views.py:361-377anddocs/design.md:1108are correct at head, and its passing test counts reproduce.
Findings
P0: none.
P1: none. The round-1 P1 (the doc guard searched all of SDK.md) is fixed.
P2 (non-blocking):
-
The PR body still describes round 1.
- It cites
SDK.md:1476-1480, now1476-1481. - It cites
tests/test_compaction_windows.py:269-276, now269-285. - It says the test "asserts that SDK.md mentions
require_partition_filter". - It shows round 1's failing-test output for a line that no longer exists (
assert "`require_partition_filter`" in f.read()at:276). - It doesn't mention the "not a drop-in replacement" clause.
The test still fails without the note at head: with base
SDK.mdit fails withassert Falseat:281. The PR body doesn't reach main's history in any merge mode here: squash merges useCOMMIT_MESSAGES, and both commit messages are accurate; merge commits usePR_TITLE. Updating the body would keep the evidence reviewers see in sync with the head. - It cites
-
(Optional) failure message. The bare
assert any(...)(tests/test_compaction_windows.py:281-285) fails asassert False/where False = any(<generator ...>). A one-line message naming the missing paragraph and pointer would make a doc-sync failure explain itself. -
(Optional, carried over from round 1, code unchanged.) The
"timestamp" not in rowcheck (:274) only matches the literal column name.test_fractional_window_survives_conversionstill catches a renamed column.
Not verified: live BigQuery behavior, namely the require_partition_filter failure through compaction_windows and partition pruning through adk_event_compactions. No cloud resources were used. I did not run the full test suite locally; CI ran it on 3.10-3.14.
Blindness: I was not exposed to any other reviewer's material.
VERDICT: APPROVE @ a64e469
6e536dc
into
GoogleCloudPlatform:main
…umns (#514) * chore(release): 0.6.0 — span OTel correlation, ViewManager denied_columns Bump [project].version from 0.5.4 to 0.6.0 and cut CHANGELOG.md for the 10 PRs merged since v0.5.4 (#502, #504–#510, #512, #513). [Unreleased] becomes [0.6.0] - 2026-10-08 with a release-highlights lead, and a new empty [Unreleased] sits above it. The #510 entries already under [Unreleased] are kept and checked against the code: denied_columns is keyword-only and exact-case, a bare string raises TypeError, the six per-event views it skips are named, the CLI exits 2 on an invalid name, and the event-specific view columns move two positions later. The SDK.md correlation guide moves to Documentation. Every other PR in the range gets an entry marked as in the wheel or repo side; the Removed entry lists the incidental module attributes #504 dropped. 0.6.0 rather than 0.5.5: besides new public API, per-event views now select two more columns ahead of the event-specific ones, and over an events table without an attributes column they deploy only with denied_columns=["attributes"]. No code, dependency or workflow change. * docs(changelog): scope the non-string ID guarantee to the attributes fallback The [0.6.0] Span entry said the three correlation IDs stay None on rows "with non-string values". Span.from_bigquery_row() applies that check only to values it reads from attributes: a truthy same-named column value is returned unchanged ({"otel_span_id": 123} gives 123), while a non-string value in attributes is ignored and gives None. Say that the attributes fallback ignores non-string values, and that the fields stay None on rows without those columns or keys. CHANGELOG wording only; the version stays 0.6.0.
Summary
This is a nightly catch-up on #501 (Release 0.5.4). The 0.5.4 CHANGELOG records a known limitation of the
compaction_windowsview (#216 / #494): the view exposes no eventtimestampcolumn, so a query through it gets no partition pruning and fails on a table that setsrequire_partition_filter(CHANGELOG.md:38). SDK.md'scompaction_windowssection is the view's reference doc, and it did not mention this limitation. The #501 hand-off also listed it as an open doc follow-up.This PR changes two files and no code:
SDK.md:1476-1480adds a "Known limitation" paragraph to thecompaction_windowssection. It uses the CHANGELOG's wording and points time-bounded queries to theadk_event_compactionsper-event view, which keeps thetimestampheader.tests/test_compaction_windows.py:269-276addstest_partition_limitation_is_documented. It runs the view query on the existing SQLite harness and asserts that the output row has notimestampcolumn, then asserts that SDK.md mentionsrequire_partition_filter. If a later change adds atimestampcolumn, the first assertion fails, so the note is removed along with that fix.No view SQL, API, version or CHANGELOG change.
Evidence the limitation is real (on
mainat 1304d5b)SELECT DISTINCT(src/bigquery_agent_analytics/views.py:361-377) returns onlyapp_name,user_id,session_id,invocation_id,start_ts,end_ts,start_secondsandend_seconds. There is no eventtimestampcolumn, so a query through the view has no column to filter on the partitioning column.PARTITION BY DATE(timestamp)(docs/design.md:1108).CHANGELOG.mdmentioned the limitation. A repo-widegit grep -nE 'require_partition_filter|partition pruning|partition filter' -- ':!CHANGELOG.md'matched nothing in SDK.md or in any doc about the view. Its only matches were inmaterialize_window.py, that module's test, and the OTLP receiver design doc.ViewManager(...).get_view_sql("EVENT_COMPACTION")buildsadk_event_compactionswith atimestampcolumn in its select list.Verification (local, macOS, Python 3.13)
Red, with the new test in place and before the SDK.md edit:
The failure is at the SDK.md assertion. The
"timestamp" not in rowassertion on line 273 passed.Green, after the SDK.md edit:
The skip is the opt-in live BigQuery test,
test_compaction_windows_bigquery_contract, which needsBQAA_LIVE_BQ=1. The worktree is not pip-installed, so these runs used the dev venv's Python with a dist-info shim onPYTHONPATH. The 135-test run also putpytest-asyncioonPYTHONPATH. Without it, the async testTestSemanticDrift::test_compute_drift_with_embedding_modelfails locally with "async def functions are not natively supported", and that failure is unrelated to this diff.Format and hygiene, using the CI Format job's pins (
pyink>=24.3.0,<26,isort>=5.0):The SDLC-notes guard's
findforintent.md/plan.md/spec.mdreturns nothing.Not verified
require_partition_filterwas not run, because this run has no cloud spend. The statement follows from the view's column list and repeats the CHANGELOG's wording.Out of scope
Adding an event
timestampcolumn to the view changes the view SQL, so it is not in this PR. Once that fix lands, this note and test should be removed.