mo.ui.altair_chart error with timestamp and aggregation encode
making selection on chart results in error if timestamp is used:
unsupported operand type(s) for /: 'str' and 'int'no error if timestamp column isn't used in encode
Solution:Jump to solution
@lovuikeng i have a fix for this: https://github.com/marimo-team/marimo/pull/3135
GitHub
fix: altair chart for datetimes with no timezone expected by mscoln...
Converting to js maps will add a timezone when the backend dtypes don't expect one. Converting to epoch millis is better for this. In the case somehow we receive a timezone, we will drop it...
15 Replies
Someone will reply to you shortly. In the meantime, this might help:
the error appears on 0.9.33. tried 0.9.34 which seems to have fixed the issue but reactive binding doesn't work on chart selection, nothing from chart.value
Yep this was just fixed in latest. Can you share the code where you get no results from chart selection
here's the dataframe used for the chart
can you share copy/pastable code with the reproduciton?
$ uv tool run marimo@0.9.34 edit --sandbox --port 2730 at.py
Solution
@lovuikeng i have a fix for this: https://github.com/marimo-team/marimo/pull/3135
GitHub
fix: altair chart for datetimes with no timezone expected by mscoln...
Converting to js maps will add a timezone when the backend dtypes don't expect one. Converting to epoch millis is better for this. In the case somehow we receive a timezone, we will drop it...
THANK YOU!
that really helps
btw, out of topic here, is there example or script for this multi-column feature? https://x.com/themylesfiles/status/1864475849526816937 , i know it's still experimental, great to have it to save ui real estate, long scrolling is kind of tiring and context distracting 🙂
myles (@themylesfiles) on X
multi-column notebooks in @marimo_io are a serious gamechanger
super easy to explore...NYC rats 🐀
Twitter
can't wait for it to become part of ui widgets
@lovuikeng its in the Settings Modal > Labs > Multi-column
yes, i'd noticed but don't know how to use it, i mean i don't see option to create multi column
Oh it’s in the column width option in the top right app settings
i see, shall try, thanks🙏
font size too adjust itself accordingly, NICE! really neat, thank you for such great addition to marimo 🚀