Get help from the marimo community

Updated 2 months ago

Potential bug in drop-down UI elements

At a glance

The community member in the post is asking if casting datetimes to strings is supposed to work. In the comments, another community member explains that the mo.ui.dropdown library only accepts string types at the moment. They suggest casting the datetimes to strings or using the mo.ui.dropdown.from_series() method, which will also convert the data types to strings. However, the community member notes that the values returned will be strings, and if the original data types (such as integers or datetimes) are needed, they recommend filing a feature request to add support for those data types.

Is this supposed to work? If I cast the datetimes to a string, it appears to work
M
1 comment
mo.ui.dropdown, only accepts string types at the moment.

  1. you can cast to a string like you do
  2. you can use mo.ui.dropdown.from_series(df["col_name"] which will also do that for you.
the .value you get back though will be a string. if you want the same datatypes you pass in (int, datatimes), can you file a feature request and we can support that.
Add a reply
Sign up and join the conversation on Discord