Annotation text integer array error message

When I adding a vline to my graph it works perfect:

fig.add_vline(
        x=pd.to_datetime('1970-01-01 00:00:00'),
        line_dash='dot',
        row=0)

image

But when I try adding an annotation text alongside the vline I get an error message

fig.add_vline(
    x=pd.to_datetime('1970-01-01 00:00:00'),
    line_dash='dot',
    annotation_text='15',
    row=0)

TypeError: Addition/subtraction of integers and integer-arrays with Timestamp is no longer supported. Instead of adding/subtracting n , use n * obj.freq

3 Likes

I have this same issue!! :(((

Hello @bparzonz,

Can you post your code so that we can see if we can figure out what is going on? Or something to at least get us in the ball park.

Hey thanks for the reply!

This is apparently an open issue still within plotly.

There is a workaround, but an actual fix doesn’t appear to be moving very quickly

Are you using categories?

It didnt seem to be too difficult to use in the example that they had put. I also have an interface where it gives me an error saying it expects the x value to be a float or an int.

Nope! I was able to use the workaround just fine, it just required a little extra legwork because I wasn’t using timestamps, I was using datetimes.