gusutabopb / aioinflux

Asynchronous Python client for InfluxDB
MIT License
159 stars 31 forks source link

Chunked reponse to DataFrame #23

Closed dasdachs closed 5 years ago

dasdachs commented 5 years ago

First of, thank you! Great repo with excellent documentation. I use it with a Starlette project I am working on.

In the project I've implemented a simple way to parse a pandas.Dataframe from a chuncked response. It works, and I added it to my fork and I am wondering if you would welcome such a feature.

Here is the MVP implementation in my fork

I'll clean the code, remove exceptions, move it to serialization/dataframe.py and add tests if you're OK with it.

gusutabopb commented 5 years ago

Hi, I am glad you find this library useful.

I am not quite sure why I left this functionality unimplemented but since it seemed rather trivial, I just implemented it on the last few commits (mostly this one: e3c2a0bcb2cd56c81b64ade6b02e863c5cdb5e6a).

With this implementation approach, there was no need to touch serialization/dataframe.py. The chunks are serialized one by one and can be later concatenated on user code using pd.concat. See the updated docs for some more concrete examples: https://github.com/gusutabopb/aioinflux/blob/master/docs/usage.rst#chunked-responses

I will make a release containing this feature shortly, but in the mean time please see if you find this useful with the code available on the master branch.

dasdachs commented 5 years ago

Great solution!! I'll update my dependencies and implement it in my file! I'll let you know it any bugs show up, but I'd consider it closed.

Thank you!