Skip to content

fix: refuse a numeric column on a date axis with a clear error instead of a 500 on zoom - #148

Merged
jvdd merged 4 commits into
mainfrom
fix/numeric-on-date-axis
Oct 5, 2026
Merged

jvdd merged 4 commits into
mainfrom
fix/numeric-on-date-axis

Conversation

@jvdd

@jvdd jvdd commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

A numeric column on an axis with type: "date" rendered, and then every zoom returned 500 ('str' - 'str' in the line bucket grid). Linked axes already refused this setup. Now every figure axis refuses it.

  • check_axis_link_types is now check_axis_types. It refuses a numeric column on a date axis for every figure axis, linked or not, and tells the user to cast the column to Datetime.
  • The builder raises it in Python when the dashboard has data. /share and /view return 400, and /dashboard/update returns 422.
  • An axis type set through layout.template now counts too (_layout_axis merges the template axis under the figure's own settings, as the client's isLogAxis does; a figure value of None counts as unset). This also applies to the existing link checks (log axes, reversed axes).
  • check_axis_types takes a schema lookup and calls it only for a date axis or a linked axis, so a spec build without either still reads no schema.

Tests: builder and server rejection (also through a template), and the combinations that must still work (Datetime on a date axis, numeric on a default or linear axis, a figure linear type over a template date type).

Closes #81

@codspeed

codspeed Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks


Comparing fix/numeric-on-date-axis (9492140) with main (fc50448)

Open in CodSpeed

@jvdd
jvdd force-pushed the fix/numeric-on-date-axis branch from 153bf48 to 9492140 Compare October 5, 2026 08:26
@jvdd
jvdd merged commit dd522fd into main Oct 5, 2026
19 checks passed
@jvdd
jvdd deleted the fix/numeric-on-date-axis branch October 5, 2026 08:48
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.

Axis handling gaps found while reviewing linked axes

1 participant