-
Notifications
You must be signed in to change notification settings - Fork 186
Closed as not planned
Labels
invalidThis doesn't seem rightThis doesn't seem rightwontfixThis will not be worked onThis will not be worked on
Milestone
Description
Specifications
- Client Version: 1.31.0
- InfluxDB Version: InfluxDB Cloud (runtime.version() returns v0.184.2)
- Platform: Linux
Using the python SDK in batching mode:
- Sending Point object data
- The client is closed before the flush interval has passed
- No data is sent to influx.
This is probably due to flush()
not being implemented, nor invoked from __del__()
or close()
, despite the PyDoc documentation saying otherwise (!!!)
Code sample to reproduce problem
class InfluxWriter:
def open(self, partition_id, epoch_id):
print("========> Opening connection to Influx")
token = os.getenv("INFLUXDB_TOKEN")
org = os.getenv("INFLUXDB_ORG")
url = os.getenv("INFLUXDB_URL")
bucket = os.getenv("INFLUXDB_BUCKET")
self.org = org
self.bucket = bucket
self.client = influxdb_client.InfluxDBClient(url=url, token=token, org=org)
self.write_api = self.client.write_api(write_type = WriteType.batching)
return True
def process(self, row):
logging.warning("Sending data to influx %s", row)
point = Point("test_measurement_1")
value = row
point.time = value["window_end"]
point.field("count", value["count"])
self.write_api.write(bucket=self.bucket, org=self.org, record=point)
def close(self, error):
logging.warning("Closing connection to influx")
self.write_api.close()
self.client.close()
writer = InfluxWriter()
writer.open()
writer.process({"window_end": datetime.now(), "count": 1})
writer.close()
Expected behavior
When closing the write API, all data pending in the current batch should be written out to influx in blocking fashion.
Actual behavior
No data is sent to influx due to the flush timer not being triggered.
Additional info
No response
Metadata
Metadata
Assignees
Labels
invalidThis doesn't seem rightThis doesn't seem rightwontfixThis will not be worked onThis will not be worked on