Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

write_points of Pandas DataFrameClient ( Pandas 0.24.2) is not working #738

Open
stevejobsmyguru opened this issue Jul 22, 2019 · 8 comments

Comments

@stevejobsmyguru
Copy link

I tried to push Pandas Data Frame using write_points of DataFrameClient object (Python Package: 5.2.2).

It did not write and did not throw any exception in Influx log too when I did tail -f command.

Then I downgraded Pandas Package to 0.23.4. Then write_points method is able to push the data into InfluxDB. I feel that it is short term fix I figured out. But Influx client package must be fixed.

Can you pls. support on this front.

@Andytmlr80
Copy link

I'm experiencing this issue as well. Our cloud platform is running Pandas 0.25.0 and the even the Pandas tutorial example from the Influxdb site does not work (https://influxdb-python.readthedocs.io/en/latest/examples.html#tutorials-pandas).

Reverting to Pandas 0.23.4 does work, however that's not a practical solution for us.

@s-okmt
Copy link

s-okmt commented Aug 6, 2019

I had the same situation.
I reviewed codes & found it's caused by a change on DataFrame.to_dict().
You may specify protocol="json" for write_points. If so, a tentative solution is to use protocol="line", since a problem is in a method for conversion from dataframe to json.

Before pandas v0.24.0 to_dict for empty dataframe returns an array of empty dicts & its quantity is same as the number of row of the dataframe.
From v0.24.0, it returns an empty array, without any dict.
In _convert_dataframe_to_json() (a method called from write_points), to_dict is used to generate some variables & it is zipped with other variables. Due to the change on pandas, the zip doesn't work well now, i.e. returns an empty iterator.

As the line protocol option on write_points does not use to_dict, I could confirm my code worked well with it (my influxdb package is v5.2.2 & pandas is v0.24.2). I would like to tentatively use this instead of json option.

@sebito91
Copy link
Contributor

sebito91 commented Aug 8, 2019

Yes, this needs to be fixed. I'm looking into this now...thanks a lot for your patience!

@stevejobsmyguru
Copy link
Author

stevejobsmyguru commented Aug 9, 2019 via email

@audiofeature
Copy link

I advocate for this to be fixed as well. New user to Influx DB -> very frustrating.

@kevmk04
Copy link

kevmk04 commented Sep 3, 2019

Same issue... was struggling to figure out why it wasn't working.

@dtosato
Copy link

dtosato commented Jan 22, 2020

This issue is somehow closely related with the issue #696, in fact even for that issue it is necessary to downgrade to Pandas 0.23.4. Please fix the issue, otherwise it is not possible to use colab with influx data.

@Karan-M-Shah
Copy link

Any updates on this issue? I cannot write a dataframe into influx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants