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

Drop pandas DataFrame NaN values for json protocol #587

Closed
wants to merge 29 commits into from

Conversation

tux-00
Copy link

@tux-00 tux-00 commented May 17, 2018

This PR drop NaN values when converting df to dict in json protocol. I removed staticmethod decorator from _convert_dataframe_to_json to use a new static method.

Related to #422, #576, #436

for ts, tag, rec in zip(dataframe.index,
dataframe[tag_columns].to_dict('record'),
dataframe[field_columns].to_dict('record'))
for ts, tag, rec in dataframe_zip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got an error when all fields contain NaN values. I changed this to
for ts, tag, rec in dataframe_zip if any(rec)
to skip the points with all empty fields.

@xginn8
Copy link
Collaborator

xginn8 commented Jul 1, 2018

@tux-00 would you mind adding a test to check that NaNs are handled properly?

@tux-00
Copy link
Author

tux-00 commented Jul 22, 2018

Yes, when I have time to do it ! I keep this PR in mind.

@tux-00
Copy link
Author

tux-00 commented Jul 29, 2018

Hey, I need help with tests.

I added the test but I have a problem with the numpy package:
First build : https://travis-ci.org/influxdata/influxdb-python/builds/409483093
Second build : https://travis-ci.org/influxdata/influxdb-python/builds/409485038

Why the first build says that no numpy module is present ?

I tried to add numpy definition in test-requirements.txt but numpy seems to be imported by tox.ini

Can anyone help me with the numpy module import ?

@tux-00
Copy link
Author

tux-00 commented Aug 23, 2018

The test is OK with 2.7 and 3.6 but with 3.5 I got a strange error "Plugin 'travis' could not be loaded".

@tux-00
Copy link
Author

tux-00 commented Apr 23, 2019

Hey, can someone take a look at the CI error ? I need some help here.

@aviau
Copy link
Collaborator

aviau commented Apr 23, 2019

Did you rebase on master recently? AFAIK some CI issues were fixed there.

aviau and others added 10 commits April 24, 2019 12:24
* Unpin setuptools to fix travis

Signed-off-by: Matthew McGinn <[email protected]>

* Add some ignores for new flake8 tests

Signed-off-by: Matthew McGinn <[email protected]>
cryptography-2.5 is not compatible with PyPy < 5.4
* fix already tz-aware error

* fix tests tz_localize

* update CHANGELOG.md
Signed-off-by: Matthew McGinn <[email protected]>
* add py37 and recent influxdb

* remove useless py34 dep

* use py36 for pydocstyle (py27 soon deprecated)

* ugly fix to numpy inconsistencies

* py37 is not in ubuntu 14.04

* move import numpy and add noqa

* get 3.7 into travis matrix

* get 3.7 into travis matrix
* numpy might use non-numerical version

* update

* update CHANGELOG.md
xginn8 and others added 7 commits April 24, 2019 12:24
* add bind_params to query
* tutorial for bind_params
* Add CQs management methods to the client
* Fix a warning under Python 3.7

Signed-off-by: Matthew McGinn <[email protected]>
Due to lack of documentation for UDP, this example
provides basic usage of sending information points
via UDP. The code structure followed is similar, if
not same as other examples in the `examples` directory.

Signed-off-by: Shantanoo <[email protected]>
@tux-00
Copy link
Author

tux-00 commented Apr 24, 2019

Is the rebase good ? Maybe I did something bad again.

@tux-00
Copy link
Author

tux-00 commented May 10, 2019

Can anyone merge this PR ?

@tux-00
Copy link
Author

tux-00 commented Jul 22, 2019

Is there someone here ?

@aviau
Copy link
Collaborator

aviau commented Jul 22, 2019

I'll look at this when I have time, sorry for the delay. Maybe someone else from the team will have time before me.

@sebito91 sebito91 self-assigned this Apr 8, 2020
@sebito91
Copy link
Contributor

sebito91 commented Apr 9, 2020

These changes were addressed in #812 , closing for now.

@sebito91 sebito91 closed this Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants