Skip to content

Add paginated tables and page numbers - #4

Merged
mattsenicksigma merged 4 commits into
feat/actions-and-schedulesfrom
feat/paginated-table-page-numbers
Oct 13, 2026
Merged

mattsenicksigma merged 4 commits into
feat/actions-and-schedulesfrom
feat/paginated-table-page-numbers

Conversation

@mattsenicksigma

@mattsenicksigma mattsenicksigma commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Merge order: #5 → #6 → #4. This PR is stacked on #6 (its base is feat/actions-and-schedules); retarget to main once #6 merges.

Rebuilt on #5's layout. #5 rewrote the layout engine as a recursive tree, so this PR's engine changes were re-applied on it rather than merged textually: paginate= on table / pivot_table (flow="paginated" on the layout entry), the rule that a paginated element is the last block on its page and cannot sit in a row, stack or panel (now in check_block / flow), row(lead=) (in row_cell_widths and a new row_lead_offset), page_number() and report(page_numbers=). report_from_args forwards page_numbers. check_layout.py keeps this PR's paginated-flow checks and #5's overlap=true allowance. schema.yml entries are in signature order (dbt validates the order).

Now verified in Sigma (this PR's own "not verified" item): flow="paginated" is accepted by Sigma's validator, and a rendered 70-row table continued onto a second page with the footer reading "1 of 2" and "2 of 2". The README's Tables section now lists all four ways to show more rows and when to use each (rows / h='fill', window, table_pages from #5, paginate=true).

Summary

Closes two gaps against Sigma's report example library: Report with a paginated table and Report with a page number.

  • table(..., paginate=true) and pivot_table(..., paginate=true) (Sigma's "Expand table rows"): emitted as flow="paginated" on the element's layout entry, so the table grows to all its rows at render time and continues onto further pages. h is the height it starts with.
  • A paginated element must be the last block on its page and cannot sit in a row, stack, header or footer. Sigma's docs don't say how far content below an expanded table is pushed, so the package refuses to guess; the rule is enforced at compile time and in scripts/check_layout.py.
  • page_number() and report(page_numbers=true): Sigma's {{CurrentPageNumber()}} of {{TotalPageCount()}} text at the right of the footer on every page. With a footer of your own, its elements share the footer row with the number. row() gains lead= so a lone element can sit at the right.

Presets

  • simple_statement is rebuilt on both: totals above the table, a paginated line-item table last, footer note plus page number in the footer (a statement can now be any length).
  • simple_dashboard gains table_paginate.
  • simple_executive_summary and simple_period_review are unchanged; they can take report_args={'page_numbers': true}.

Tests

New integration models sigma_paginated_tables and sigma_footer_page_numbers; assertions for layout flow, totals-above-table, footer panel contents and page numbers; 7 new negative cases; 4 new check_layout unit tests; updated goldens and schema.yml.

  • bash scripts/run_integration_tests_duckdb.sh on dbt 1.x and dbt 2.x with PARSE_FLAGS=--warn-error
  • python -m unittest discover -s scripts -p "test_*.py" (37 tests)
  • python scripts/export_reports.py --push --dry-run against Sigma (needs credentials; not run). Worth doing before merge: flow="paginated" is taken from Sigma's example, and the offline schema check cannot see it because layout is an opaque XML string.

Not covered

Element layering and repeated containers (still raw() only), per the earlier gap review.

🤖 Generated with Claude Code

table and pivot_table take paginate=true (Sigma's "Expand table rows"), emitted as
flow="paginated" on the layout entry. A paginated element must be the last block on its
page and cannot sit in a row, stack or panel, enforced at compile time and by
check_layout.py. page_number() and report(page_numbers=true) add a "{page} of {total}"
number to the footer; row() gains lead= so it can sit at the right.

simple_statement is rebuilt on both (totals above the table, note and page number in
the footer) and simple_dashboard gains table_paginate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
mattsenicksigma and others added 3 commits October 12, 2026 18:25
…numbers

Re-applies #4's features on the tree layout: paginate= on table / pivot_table (flow="paginated" on the layout
entry), the rule that a paginated element is the last block on its page (and not in a row, stack or panel),
row(lead=), page_number() and report(page_numbers=). report_from_args now forwards page_numbers and schedules.
check_layout keeps #4's paginated-flow checks and #5's overlap allowance. schema.yml gains the new arguments
(in signature order, which dbt validates). Goldens regenerate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
README: the Tables section now lists all four ways to show more rows (rows / h=fill, window, table_pages,
paginate=true) and when to pick each; paginate=true is marked as checked in Sigma. Design notes updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mattsenicksigma
mattsenicksigma changed the base branch from main to feat/actions-and-schedules October 13, 2026 01:30
@mattsenicksigma
mattsenicksigma merged commit 39f701a into feat/actions-and-schedules Oct 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant