Skip to content

Note the 1.29 prescriptive display API change for template authors - #103

Open
chriscoey wants to merge 6 commits into
mainfrom
coey-display-render-1.29
Open

Note the 1.29 prescriptive display API change for template authors#103
chriscoey wants to merge 6 commits into
mainfrom
coey-display-render-1.29

Conversation

@chriscoey

@chriscoey chriscoey commented Aug 27, 2026

Copy link
Copy Markdown
Member

Problem.display() changes in relationalai 1.29. Adds a short section to CONTRIBUTING for anyone bumping a prescriptive template's pin past 1.28.

What raises when you bump:

  • part= and where= are gone and raise TypeError. Select the display_string property on a constraint or objective and filter it with an ordinary where.
  • display() raises ValueError if any decision variable is unnamed, so pass name= to every solve_for(...). The name has to discriminate too, and that one is silent: a constant name="x" on a per-entity variable renders every constraint identically.

The rest are silent:

  • A null display_string has two common causes needing different fixes: the rendering rules are not installed (only display() installs them on demand), or a decision variable in the expression was declared without name=.
  • Under Deploy Mode, call install_display_strings() before deploying: the rules have to exist at deploy time.
  • install_display_strings() is scoped to one Problem, so a template carrying more than one calls it on each.
  • display(limit=n) still works, but samples different rows: row order moved to a plain-text sort, so over x_1..x_12, limit=5 gives x_1, x_10, x_11, x_12, x_2 where 1.28 gave x_1..x_5. The aggs.limit form orders the same way, and additionally drops constraints declared without name=.
  • The client-side depth cap is gone. A deeply nested expression no longer prints <expression too deep>; it renders on the engine instead, and render time climbs steeply with depth.

I ran the CONTRIBUTING snippet against the 1.29 branch on the deployment path; it returns what the text says.

chriscoey and others added 3 commits August 27, 2026 12:01
…1.29

Templates that call problem.display() are unaffected today (every v1
template pins 1.27.1 or older, none passes the removed part/where/limit
arguments, and every solve_for in a template that displays is named), so
this adds the migration note authors will need at the point they bump the
pin: the removed arguments and their display_string replacement, the
null-until-installed behavior of install_display_strings(), the new
unnamed-variable ValueError, and the removal of the client-side depth cap.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VxgCY8UfV3awEkrjVwMLqo
display(limit=N) survives the 1.29 change as a whole-problem printer
argument; only part= and where= raise TypeError. Also puts the
aggregates.limit example in the where-then-select order used elsewhere
(both orders work).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VxgCY8UfV3awEkrjVwMLqo
Row ordering moved to a plain-text sort, so display(limit=n) takes a
different sample than it did through 1.28. Also drops Expression as a
name to reach for; Problem exposes Constraint and Objective.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VxgCY8UfV3awEkrjVwMLqo
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

The templates docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-3yondkmqi-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/3HpARUnrSSsQAcAT1MRVBxeViXrE

…veats

Running these against the 1.29 branch showed three things the pin-bump checklist did not cover: a decision variable declared without name= renders a null display_string even after a correct install; install_display_strings() is scoped to one Problem rather than the model; and the aggregates.limit form orders names as plain text and silently drops constraints that have no name. A constant name= on a per-entity variable also renders every row identically without raising.
Two causes are the common ones, not the only ones, and the render-cost
claim is SQL-backend behaviour per the docstring.
The docstring scopes the whole-problem re-render to the SQL backend; the
depth cost carries no such qualifier. The note had it in front of the
depth clause, which reads as though depth is free elsewhere.
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