dcc.Upload... "TypeError: 'float' object is not iterable"

I’m not entirely sure why I’m getting this error.

Basically I have two upload buttons that returns stuff back to 2 corresponding divs, the first upload button works but the second creates a TypeError and it says…

Traceback (most recent call last):
  File "/comparison.py", line 94, in update_output
    parse_contents(c, n, d ) for c, n, d in zip(list_of_contents, list_of_names, list_of_dates)]
TypeError: 'float' object is not iterable

the code (i mean parse_contents() ) are pretty much identical to the example in the documentation and that bit seems to work fine. It’s the list comprehension bit that is not working. I’m not sure where the float is coming from.

I guess one of them is not a real list.

Any updates to this? I am having the same problem, it seems to be something related to having 2 different @app.callbacks. I have one button that takes user input in text form and adds it to a datatable as a row, and my other button that allows you to upload a .csv file and view the contents as a datatable.

I will ask this question on StackOverflow and hopefully get a response.

Hello @harryob2,

Welcome to the community.

Do you have a code snippet that you can give so that we may be able to emulate and test on our end?

Hi Jinny,

A great person named Hamzah replied to my question on StackOverflow and fixed it, you can have a look at that post here. Somebody at the Plotly team should have a look at the code in the documentation because it doesn’t work when there are multiple app.callbacks.

2 Likes

yeah the github link you sent it about right. I never really understood why exactly I was getting the error. Once I didn’t get the error i kept the code that way.

looking back at it… I didn’t use the date. it’s there but it’s just an empty variable