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

Make batched writing support all iterables #746

Merged
merged 5 commits into from
Apr 10, 2020

Conversation

JayH5
Copy link
Contributor

@JayH5 JayH5 commented Aug 12, 2019

We have some data we write to InfluxDB from lazy iterables/generators that don't necessarily support indexing or have a length that can be known up-front.

This is a second attempt at #408. It includes a fix for Python 3.7 compatibility (catches the StopIteration).

@JayH5
Copy link
Contributor Author

JayH5 commented Aug 14, 2019

Build is now green so I'd appreciate a review 🙏

@@ -6,14 +6,14 @@
from __future__ import print_function
from __future__ import unicode_literals

import itertools
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than importing the whole itertools module, how about just importing what's needed (islice & chain)?

Copy link
Collaborator

@xginn8 xginn8 left a comment

Choose a reason for hiding this comment

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

thanks for contributing @JayH5!

@JayH5 JayH5 force-pushed the iterable-batching-take-2 branch from a8b2bdd to d6e7d1c Compare September 10, 2019 14:22
@JayH5
Copy link
Contributor Author

JayH5 commented Sep 10, 2019

@xginn8 done, thanks.

@JayH5
Copy link
Contributor Author

JayH5 commented Jan 13, 2020

@xginn8 maybe we can get this merged now?

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

@sebito91 sebito91 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@sebito91 sebito91 merged commit de44289 into influxdata:master Apr 10, 2020
ocworld pushed a commit to AhnLab-OSS/influxdb-python that referenced this pull request Apr 13, 2020
* Make batched writing support all iterables

* Also test batching generator against real server

* Fix PEP257 error

* Import itertools functions directly
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.

3 participants