Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
1. [#167](https://github.com/InfluxCommunity/influxdb3-python/pull/167):
- Remove incorrect symbol `>>` for config.yml.
- Added spacing for `<<` and `>>` just for consistency.
1. [176](https://github.com/InfluxCommunity/influxdb3-python/pull/176): Use `ConstantFlightServerDelayed` for timeout tests.
1. [#176](https://github.com/InfluxCommunity/influxdb3-python/pull/176): Use `ConstantFlightServerDelayed` for timeout tests.
1. [#183](https://github.com/InfluxCommunity/influxdb3-python/pull/183): Temporarily add annotation to support Python 3.8.

## 0.16.0 [2025-09-15]

Expand Down
12 changes: 8 additions & 4 deletions influxdb_client_3/write_client/client/write_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Collect and write time series data to InfluxDB Cloud or InfluxDB OSS."""

# coding: utf-8
# TODO Remove after this program no longer supports Python 3.8.*
from __future__ import annotations

import logging
import os
import warnings
Expand Down Expand Up @@ -297,7 +300,7 @@ def __init__(self,
You can use native asynchronous version of the client:
- https://influxdb-client.readthedocs.io/en/stable/usage.html#how-to-use-asyncio
"""
# TODO above message has link to Influxdb2 API __NOT__ Influxdb3 API !!! - illustrates different API
# TODO above message has link to Influxdb2 API __NOT__ Influxdb3 API !!! - illustrates different API
warnings.warn(message, DeprecationWarning)

def write(self, bucket: str, org: str = None,
Expand Down Expand Up @@ -420,14 +423,15 @@ def _create_batching_pipeline(self) -> tuple[Subject[Any], rx.abc.DisposableBase
# Create batch (concatenation line protocols by \n)
ops.map(lambda group: group.pipe( # type: ignore
ops.to_iterable(),
ops.map(lambda xs: _BatchItem(key=group.key, data=_body_reduce(xs), size=len(xs))))), # type: ignore
ops.map(lambda xs: _BatchItem(key=group.key, data=_body_reduce(xs), size=len(xs))))),
# type: ignore
ops.merge_all())),
# Write data into InfluxDB (possibility to retry if its fail)
ops.filter(lambda batch: batch.size > 0),
ops.map(mapper=lambda batch: self._to_response(data=batch, delay=self._jitter_delay())),
ops.merge_all()) \
.subscribe(self._on_next, self._on_error, self._on_complete)

return subject, disposable

def flush(self):
Expand All @@ -453,7 +457,7 @@ def close(self):
"""Flush data and dispose a batching buffer."""
if self._subject is None:
return # Already closed

self._subject.on_completed()
self._subject.dispose()
self._subject = None
Expand Down
Loading