Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was 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

Description

@stevejobsmyguru

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.

Activity

Andytmlr80

Andytmlr80 commented on Jul 31, 2019

@Andytmlr80

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

s-okmt commented on Aug 6, 2019

@s-okmt

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

sebito91 commented on Aug 8, 2019

@sebito91
Contributor

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

self-assigned this
on Aug 8, 2019
stevejobsmyguru

stevejobsmyguru commented on Aug 9, 2019

@stevejobsmyguru
Author
audiofeature

audiofeature commented on Aug 26, 2019

@audiofeature

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

kevmk04

kevmk04 commented on Sep 3, 2019

@kevmk04

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

dtosato

dtosato commented on Jan 22, 2020

@dtosato

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

Karan-M-Shah commented on Feb 12, 2020

@Karan-M-Shah

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sebito91@Andytmlr80@dtosato@audiofeature@stevejobsmyguru

      Issue actions

        write_points of Pandas DataFrameClient ( Pandas 0.24.2) is not working · Issue #738 · influxdata/influxdb-python