I am trying to create csv file using python and than to upload that file to azure blob storage. I am able to create csv file, that part works fine, but when I try to upload the file to blob:
blob.upload_blob(data=df.to_csv("capacity.csv",index=False))
I get error message:
Traceback (most recent call last):
File ".\blob.py", line 94, in <module>
blob.upload_blob(data=df.to_csv("data.csv",index=False))
File "C:\Python38\lib\site-packages\azure\core\tracing\decorator.py", line 83, in wrapper_use_tracer return func(*args, **kwargs)
File "C:\Python38\lib\site-packages\azure\storage\blob\_blob_client.py", line 489, in upload_blob
options = self._upload_blob_options(
File "C:\Python38\lib\site-packages\azure\storage\blob\_blob_client.py", line 332, in _upload_blob_options
raise TypeError("Unsupported data type: {}".format(type(data)))
TypeError: Unsupported data type: <class 'NoneType'>
After that I tried to upload some local csv file, just to test if it is working:
with open(path_to_file, "rb") as data:
blob.upload_blob( data=data)
And it worked. I am not sure what is causing this error, I spent some time looking for solution, but nothing is working for me.