Skip to content

[Bug] WriteApi.flush() method is incomplete despite being documented in stable API #697

@0xsaika

Description

@0xsaika

Specifications

  • Client Version: 1.49.0
  • InfluxDB Version: InfluxDB v2 OSS
  • Platform: Linux/MacOS

Code sample to reproduce problem

influx = InfluxDBClient(
            url=influx_config.url, token=influx_config.token, org=influx_config.organization, debug=False
        )
write_api = influx.write_api(
    write_options=WriteOptions(
        batch_size=100,
        flush_interval=10_000,
        retry_interval=5_000,
        max_retries=5,
        max_retry_delay=30_000,
        max_close_wait=300_000,
        exponential_base=2,
    )
)

# ... perform some write_api.write() operation ...

write_api.flush()         # not working since it's actual implementation is TODO

Expected behavior

In my humble opinion, the flush() method should behave like:

  • Force immediate write of any buffered data to InfluxDB
  • Ensure all pending write operations are completed

Actual behavior

When flush() is called, the method executes but performs no operation due to the TODO implementation

def flush(self):
"""Flush data."""
# TODO
pass

Even if write_api.flush() is marked as stable API
https://influxdb-client.readthedocs.io/en/stable/api.html#influxdb_client.WriteApi.flush

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions