lovuikeng
lovuikeng3w ago

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
No description
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...
Jump to solution
15 Replies
Hall
Hall3w ago
Someone will reply to you shortly. In the meantime, this might help:
lovuikeng
lovuikengOP3w ago
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
Myles Scolnick
Yep this was just fixed in latest. Can you share the code where you get no results from chart selection
lovuikeng
lovuikengOP3w ago
here's the dataframe used for the chart
No description
Myles Scolnick
can you share copy/pastable code with the reproduciton?
lovuikeng
lovuikengOP3w ago
appreciate the attention, here's the notebook
lovuikeng
lovuikengOP3w ago
$ uv tool run marimo@0.9.34 edit --sandbox --port 2730 at.py
Solution
Myles Scolnick
@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...
lovuikeng
lovuikengOP3w ago
THANK YOU! that really helps
lovuikeng
lovuikengOP3w ago
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 🐀
From An unknown user
Twitter
lovuikeng
lovuikengOP3w ago
can't wait for it to become part of ui widgets
Myles Scolnick
@lovuikeng its in the Settings Modal > Labs > Multi-column
lovuikeng
lovuikengOP3w ago
yes, i'd noticed but don't know how to use it, i mean i don't see option to create multi column
Myles Scolnick
Oh it’s in the column width option in the top right app settings
lovuikeng
lovuikengOP3w ago
i see, shall try, thanks🙏 font size too adjust itself accordingly, NICE! really neat, thank you for such great addition to marimo 🚀

Did you find this page helpful?