Strange behaviour on the first run of client.write()

What is the problem when reproducing an example from the repo I’m facing with the fact that the first run doesn’t write a record. The recording is observed only on the second run of the same code chunk.

image: deployed in minikube

Write Dictionary-style object
_write_client.write(bucket, org, {"measurement": "h2o_feets", "tags": {"location": "coyote_creek"},\
                                  "fields": {"water_level": 4.0}, "time": datetime.utcnow()})

query = f'from(bucket:"{bucket}") |> range(start: -20m)' \
        f'|> filter(fn: (r) => r["_measurement"] == "h2o_feets")'
tables = _client.query_api().query(query, org=org)

FluxTable() columns: 9, records: 1
Out {‘result’: ‘_result’, ‘table’: 0, ‘_start’: datetime.datetime(2020, 9,…

Hi @sboris,

the example shows how to writes data in batch mode. To be sure that all data are written use _write_client.__del__() or use SYNCHRONOUS mode for _write_client:

write_api = client.write_api(write_options=SYNCHRONOUS)