You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SchemaValidationError: Multiple errors were found.
Error 1: '{'year': 2024, 'month': 10, 'date': 8}' is an invalid value for `max`. Valid values are of type 'number'.
Error 2: '{'year': 2024, 'month': 7, 'date': 1}' is an invalid value for `min`. Valid values are of type 'number'.
It would be convenient if these worked with dates instead of just timstamps. If I don't include min and max at all, the value of the date displays as expected initially (although formatting is a bit verbose, maybe that should be configurable or at least limit to the same level of detail as the underlying date if possible), but disappears when the slider is moved (since the slider range is the default 1 to 100).
Have you considered any alternative solutions?
I don't think there is an alternative unless we want to convert everything to timestamps again as in this SO answer.
The text was updated successfully, but these errors were encountered:
@joelostblom you might be able to get this working by triggering the Expression conversion instead of SchemaBase?
I'm not 100% sure what that would look like for your example though
importdatetimeasdtimportaltairasalt# SchemaBasealt.binding_range(min=dt.date(2000, 1, 1))
# SchemaValidationError: '{'year': 2000, 'month': 1, 'date': 1}' is an invalid value for `min`. Valid values are of type 'number'.# Expressionalt.binding_range(min=alt.expr.parseFloat(dt.date(2000, 1, 1)))
# SchemaValidationError: 'parseFloat(datetime(2000,0,1))' is an invalid value for `min`. Valid values are of type 'number'.
What is your suggestion?
I was playing around with the much improved date support from #3653 and noticed that the min/max parameters in sliders don't accept date values:
It would be convenient if these worked with dates instead of just timstamps. If I don't include
min
andmax
at all, the value of the date displays as expected initially (although formatting is a bit verbose, maybe that should be configurable or at least limit to the same level of detail as the underlying date if possible), but disappears when the slider is moved (since the slider range is the default 1 to 100).Have you considered any alternative solutions?
I don't think there is an alternative unless we want to convert everything to timestamps again as in this SO answer.
The text was updated successfully, but these errors were encountered: