mo.ui.altair_chart() reinterpreting str x-axis as datetime.
I have a
altair.Chart()
which outputs fine if I render it directly but if I wrap it in a mo.ui.altair_chart()
then the string x-axis values which are versions of the form "x.y.x" are getting evaluated as datetimes so the graph is exactly the same except the x-values are erroneously shown as datetimes. How can I stop this? See https://imgur.com/a/0wFfaYk. First graph is raw altair graph, second is wrapped graph.Imgur
Untitled Album
9 Replies
Someone will reply to you shortly. In the meantime, this might help:
I've created a trivial example of this as follows. Could this be a marimo bug?
If you don’t wrap it in an altair_chart, is there still a bug?
Thanks for the minimal repro, we can fix this if it’s a marimo bug
Look at the image I posted above, 1st image is my app just rendering the chart directly as
chart
, the second image is merely wrapping it in mo.ui.altair_chart(chart)
.Ah yea I see now. Thanks, this is a bug in marimo then. We auto-infer the data type and we should not for charts
So I should raise an issue?
That would be great, thank you very much
Issue raised here: https://github.com/marimo-team/marimo/issues/3330
GitHub
mo.ui.altair_chart() reinterpreting string x-axis as datetime · Iss...
Describe the bug I have a altair.Chart() which outputs fine if I render it directly but if I wrap it in a mo.ui.altair_chart() then the string x-axis values which are versions of the form "x.y...
just wanted to followup this was fixed in https://github.com/marimo-team/marimo/pull/3335
GitHub
fix: only parse valid ISO date strings in DATE_MIDDLEWARE by devin-...
Fixes #3330
Added strict ISO date string validation in DATE_MIDDLEWARE to prevent incorrect parsing of version-like strings (e.g., "1.1.1") as dates. This ensures we maintain cons...