Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Received value: 'rgba(255, 153, 51, np.float64(1.0))' when using cufflinks to make figures after upgrading python to 3.13.2 and plotly to 6.0.0 #5046

Open
Rob-Hulley opened this issue Feb 20, 2025 · 3 comments
Labels
bug something broken P2 considered for next cycle regression this used to work

Comments

@Rob-Hulley
Copy link

I needed to rebuild my windows workstation (win 10) and decided to install the latest python and plotly software.
Now all my charts using cufflinks fail with the error:

ValueError:
Invalid value of type 'builtins.str' received for the 'color' property of bar.marker.line
Received value: 'rgba(255, 153, 51, np.float64(1.0))'

Edition Windows 10 Pro
Version 22H2
Installed on ‎17/‎02/‎2025
OS build 19045.5487
Experience Windows Feature Experience Pack 1000.19061.1000.0

Python 3.13.2
pandas 2.2.3
plotly 6.0.0
cufflinks 0.17.3

The below code will recreate the issue in Jupiter labs

from plotly.subplots import make_subplots
import plotly.graph_objects as go
import plotly.io as pio
import pandas as pd
import cufflinks as cf

index=['2024-09-05 05:56:33.238','2024-09-05 05:56:34.238','2024-09-05 05:56:35.241','2024-09-05 05:56:36.239','2024-09-05 05:56:37.239',
'2024-09-05 05:56:38.241','2024-09-05 05:56:39.239','2024-09-05 05:56:40.239','2024-09-05 05:56:41.240','2024-09-05 05:56:42.240']

cols=pd.MultiIndex.from_tuples([
('rcount','0:3:1'),('rcount','0:3:2'),('rcount','1:3:1'),('rcount','1:3:2'),
('wcount','0:3:1'),('wcount','0:3:2'),('wcount','1:3:1'),('wcount','1:3:2'),
('tcount','0:3:1'),('tcount','0:3:2'),('tcount','1:3:1'),('tcount','1:3:2'),])

data=[[22.0,21.0,32.0,31.0,24.0,20.0,40.0,40.0,47.0,42.0,72.0,72.0],
[0.0,0.0,0.0,0.0,4.0,2.0,4.0,1.0,4.0,2.0,4.0,1.0],
[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
[0.0,0.0,0.0,1.0,0.0,0.0,2.0,4.0,0.0,0.0,2.0,5.0],
[0.0,0.0,0.0,0.0,3.0,1.0,16.0,11.0,3.0,1.0,16.0,11.0],
[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
[0.0,0.0,0.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,0.0],
[0.0,0.0,1.0,0.0,4.0,2.0,9.0,0.0,4.0,2.0,11.0,0.0],
[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
[0.0,0.0,0.0,0.0,2.0,1.0,2.0,1.0,2.0,1.0,2.0,1.0]]

df=pd.DataFrame(data, columns=cols,index=index)

fig = cf.subplots([df.loc[:,('rcount')].figure(kind='scatter'),
df.loc[:,('wcount')].figure(kind='scatter'),
df.loc[:,('tcount')].figure(kind='scatter'),],
shape=(3,1),shared_xaxes=True,shared_yaxes=False,subplot_titles=('READ','WRITE','TOTAL'))

@gvwilson gvwilson added bug something broken P2 considered for next cycle regression this used to work labels Feb 20, 2025
@gvwilson
Copy link
Contributor

Thanks for the report @Rob-Hulley - I'll see if we can have someone take a look in the next cycle. Is there any easy way to see if it works without cufflinks, or would that essentially mean rewriting the whole app / example?

@Rob-Hulley
Copy link
Author

My program creates 1000's of charts about 100 use cufflinks.
All other charts are OK, it is just cufflinks which has the error about the color selection.
I think it is the np.float64(1.0) causing the issue.
cufflinks does not seem to like the later version of numpy.

I can re-write those charts to not use cufflinks, but cufflinks makes things much easier.
For now I will revert back to the older versions that work so I can continue to update code.

@Rob-Hulley
Copy link
Author

This is what the values look like in the working older code

rgba(255, 153, 51, 1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle regression this used to work
Projects
None yet
Development

No branches or pull requests

2 participants