Skip to content

Zooming a Time or Duration axis returns 500 #79

Open

Description

@jvdd

Problem

Plotly draws Time and Duration values on a category axis: Time as strings like "00:08:52", Duration as ISO strings like "PT8M52S". A zoom then reports the range as category positions, not values: 89.6 to 149.5 in the test below. The engine uses those positions as data bounds, and the request fails with HTTP 500:

  • Time: InvalidOperationError: could not determine supertype of: [time, datetime[μs]] in expression 'search_sorted'
  • Duration: InvalidOperationError: casting from Duration('μs') to Datetime('μs') not supported

Reproduction

Public API only, verified on main on 2026-09-23 with a real mouse drag:

n = 20_000
df = pl.select(
    tod=(pl.datetime(2024, 1, 1) + pl.duration(seconds=pl.int_range(n) * 4)).dt.time(),
    val=pl.Series(np.sin(np.arange(n) / 300)),
)
dash = Dashboard(df)
dash.add_figure().add_line(x="tod", y="val", n_points=300)

Drag-zoom the x axis. The initial render works, and every zoom returns 500. A Duration column (pl.duration(seconds=...)) behaves the same.

Fix direction

Send these axes to Plotly as numbers: seconds of the day for Time, the duration in a unit for Duration. Add tick labels in the time format, and convert the zoom range back to the column type in the engine. Until then, Dashboard.link_axes rejects Time and Duration axes (PR #77).

Activity

  1. added
    bug
    on Sep 23, 2026
  2. jvdd commented on Sep 29, 2026

    @jvdd
    ContributorAuthor

    Decision (2026-09-29): do the full fix. Send Time and Duration axes to Plotly as numbers (seconds of the day, duration in one unit), add tick labels in the time format, and convert the zoom range back to the column type in the engine. No stopgap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions