Does BoxAnnotation not support Timestamps?

I used the BoxAnnotation instructions from Datetime x-axis Timezone switch and I wonder why the datetime needs to be converted to a (miliseconds?) float? Why do

start_time = (pd.to_datetime('20201220T0000').timestamp())*1000


Shouldn’t BoxAnnotation support datetime objects? If I use regular datetime objects, I get

ValueError: failed to validate BoxAnnotation(id='p5934', ...).left: expected an element of either Null, Float or Factor(Either(String, Tuple(String, String), Tuple(String, String, String))), got (Timestamp('1944-06-06 00:00:00'),)

Support for this was added recently in

but the work is as yet unreleased, It will be included in a future 3.1 release.

1 Like