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.

batch_size logic in write_points too soon leaves the loop #102

Description

@zzzuzik

Hi,

I might be wrong, thus I'm just asking it here.
I believe, the merge from #20 contains a bug in the return True

        batch_size = kwargs.get('batch_size')
        if batch_size:
            for item in data:
                name = item.get('name')
                columns = item.get('columns')
                point_list = item.get('points')

                for batch in list_chunks(point_list, batch_size):
                    item = [{
                        "points": batch,
                        "name": name,
                        "columns": columns
                    }]
                    self._write_points(
                        data=item,
                        time_precision=time_precision)

                return True

        return self._write_points(data=data, time_precision=time_precision)

If data has more than one item, they are left out

This one has correct logic:
https://github.com/influxdb/influxdb-python/blob/master/influxdb/dataframe_client.py

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions