diff --git a/influxdb/client.py b/influxdb/client.py index ab9aa409..92310c78 100644 --- a/influxdb/client.py +++ b/influxdb/client.py @@ -7,6 +7,7 @@ from __future__ import print_function from __future__ import unicode_literals +import itertools import json import socket import requests @@ -411,8 +412,10 @@ def write_points(self, tags=tags, protocol=protocol) def _batches(self, iterable, size): - for i in xrange(0, len(iterable), size): - yield iterable[i:i + size] + iterator = iter(iterable) + while True: + batch_iterator = itertools.islice(iterator, size) + yield itertools.chain([next(batch_iterator)], batch_iterator) def _write_points(self, points, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy