influxdb3-python 0.18.0__tar.gz → 0.20.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/PKG-INFO +120 -6
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/README.md +117 -3
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb3_python.egg-info/PKG-INFO +120 -6
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb3_python.egg-info/SOURCES.txt +5 -16
- influxdb3_python-0.20.0/influxdb3_python.egg-info/entry_points.txt +2 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb3_python.egg-info/top_level.txt +0 -1
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/__init__.py +43 -18
- influxdb3_python-0.20.0/influxdb_client_3/__main__.py +5 -0
- influxdb3_python-0.20.0/influxdb_client_3/cli.py +211 -0
- influxdb3_python-0.20.0/influxdb_client_3/exceptions/__init__.py +4 -0
- influxdb3_python-0.20.0/influxdb_client_3/exceptions/exceptions.py +255 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/query/query_api.py +3 -1
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/version.py +1 -1
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/__init__.py +0 -3
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/_sync/api_client.py +1 -21
- {influxdb3_python-0.18.0/influxdb_client_3/write_client/service → influxdb3_python-0.20.0/influxdb_client_3/write_client/client}/__init__.py +0 -2
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/_base.py +4 -24
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/influxdb_client.py +0 -10
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write/__init__.py +0 -2
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write/dataframe_serializer.py +7 -6
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write/point.py +50 -4
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write/polars_dataframe_serializer.py +33 -22
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write_api.py +73 -13
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/configuration.py +0 -25
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/domain/write_precision.py +5 -5
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/rest.py +0 -10
- influxdb3_python-0.20.0/influxdb_client_3/write_client/service/__init__.py +6 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/service/write_service.py +80 -34
- influxdb3_python-0.20.0/influxdb_client_3/write_client/write_defaults.py +6 -0
- influxdb3_python-0.20.0/pyproject.toml +3 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/setup.py +5 -2
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_api_client.py +181 -6
- influxdb3_python-0.20.0/tests/test_cli.py +283 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_dataframe_serializer.py +24 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_influxdb_client_3.py +149 -36
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_influxdb_client_3_integration.py +46 -24
- influxdb3_python-0.20.0/tests/test_point.py +67 -0
- influxdb3_python-0.20.0/tests/test_polars.py +215 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_query.py +20 -3
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_write_local_server.py +130 -10
- influxdb3_python-0.18.0/Examples/__init__.py +0 -1
- influxdb3_python-0.18.0/Examples/basic_ssl_example.py +0 -102
- influxdb3_python-0.18.0/Examples/batching_example.py +0 -140
- influxdb3_python-0.18.0/Examples/cloud_dedicated_query.py +0 -15
- influxdb3_python-0.18.0/Examples/cloud_dedicated_write.py +0 -48
- influxdb3_python-0.18.0/Examples/config.py +0 -12
- influxdb3_python-0.18.0/Examples/flight_options_example.py +0 -22
- influxdb3_python-0.18.0/Examples/handle_http_error.py +0 -42
- influxdb3_python-0.18.0/Examples/handle_query_error.py +0 -33
- influxdb3_python-0.18.0/Examples/pandas_write.py +0 -34
- influxdb3_python-0.18.0/Examples/query_async.py +0 -86
- influxdb3_python-0.18.0/Examples/query_type.py +0 -54
- influxdb3_python-0.18.0/Examples/query_with_middleware.py +0 -33
- influxdb3_python-0.18.0/Examples/timeouts.py +0 -83
- influxdb3_python-0.18.0/influxdb_client_3/exceptions/__init__.py +0 -3
- influxdb3_python-0.18.0/influxdb_client_3/exceptions/exceptions.py +0 -121
- influxdb3_python-0.18.0/influxdb_client_3/write_client/client/__init__.py +0 -8
- influxdb3_python-0.18.0/influxdb_client_3/write_client/service/signin_service.py +0 -129
- influxdb3_python-0.18.0/influxdb_client_3/write_client/service/signout_service.py +0 -124
- influxdb3_python-0.18.0/pyproject.toml +0 -3
- influxdb3_python-0.18.0/tests/test_point.py +0 -14
- influxdb3_python-0.18.0/tests/test_polars.py +0 -99
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/LICENSE +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb3_python.egg-info/dependency_links.txt +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb3_python.egg-info/requires.txt +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/py.typed +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/query/__init__.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/read_file.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/_sync/__init__.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/_sync/rest.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/logging_handler.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/util/__init__.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/util/date_utils.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/util/date_utils_pandas.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/util/helpers.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/util/multiprocessing_helper.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/warnings.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/client/write/retry.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/domain/__init__.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/domain/write_precision_converter.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/extras.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/influxdb_client_3/write_client/service/_base_service.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/setup.cfg +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_date_helper.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_deep_merge.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_flush.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_merge_options.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_write_file.py +0 -0
- {influxdb3_python-0.18.0 → influxdb3_python-0.20.0}/tests/test_write_precision_converter.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: influxdb3-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Community Python client for InfluxDB 3.0
|
|
5
5
|
Home-page: https://github.com/InfluxCommunity/influxdb3-python
|
|
6
6
|
Author: InfluxData
|
|
@@ -8,13 +8,13 @@ Author-email: contact@influxdata.com
|
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: reactivex>=4.0.4
|
|
@@ -96,12 +96,52 @@ You can install 'influxdb3-python' using `pip`:
|
|
|
96
96
|
pip install influxdb3-python
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()
|
|
99
|
+
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()`, or to use PyArrow data conversion methods with nanosecond timestamp precision, you will need to install `pandas` separately.
|
|
100
100
|
|
|
101
|
-
*Note: Please make sure you are using 3.
|
|
101
|
+
*Note: Please make sure you are using 3.9 or above. For the best performance use 3.11+*
|
|
102
|
+
|
|
103
|
+
## CLI (Agent-Friendly Query Tool)
|
|
104
|
+
|
|
105
|
+
This package includes an `influx3` CLI for read/query workflows.
|
|
106
|
+
|
|
107
|
+
### Run a query
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
influx3 query -d my_database "SELECT * FROM cpu LIMIT 5"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
By default, output is JSON to stdout.
|
|
114
|
+
|
|
115
|
+
### Supported formats
|
|
116
|
+
|
|
117
|
+
- `json` (default)
|
|
118
|
+
- `jsonl`
|
|
119
|
+
- `csv`
|
|
120
|
+
- `pretty`
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
influx3 query -d my_database --format csv "SELECT * FROM cpu LIMIT 5"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Config precedence
|
|
127
|
+
|
|
128
|
+
Configuration values are resolved in this order:
|
|
129
|
+
|
|
130
|
+
1. CLI flags
|
|
131
|
+
2. `INFLUXDB3_*` environment variables
|
|
132
|
+
3. legacy `INFLUX_*` environment variables
|
|
133
|
+
4. built-in defaults (host defaults to `http://127.0.0.1:8181`)
|
|
134
|
+
|
|
135
|
+
Relevant environment variables:
|
|
136
|
+
|
|
137
|
+
- `INFLUXDB3_HOST_URL` (legacy fallback: `INFLUX_HOST`)
|
|
138
|
+
- `INFLUXDB3_DATABASE_NAME` (legacy fallback: `INFLUX_DATABASE`)
|
|
139
|
+
- `INFLUXDB3_AUTH_TOKEN` (legacy fallback: `INFLUX_TOKEN`)
|
|
102
140
|
|
|
103
141
|
# Usage
|
|
104
|
-
One of the easiest ways to get started is to
|
|
142
|
+
One of the easiest ways to get started is to check out the ["Influxdb3 Python Basic Usage"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/examples/jupyter/basic-write-query.ipynb) notebook. This scenario takes you through the core write and read APIs of the client library.
|
|
143
|
+
|
|
144
|
+
Additional examples independent of jupyter are detailed in the [`./examples`](./examples/README.md) directory.
|
|
105
145
|
|
|
106
146
|
## Importing the Module
|
|
107
147
|
```python
|
|
@@ -126,6 +166,30 @@ You can write data using the Point class, or supplying line protocol.
|
|
|
126
166
|
point = Point("measurement").tag("location", "london").field("temperature", 42)
|
|
127
167
|
client.write(point)
|
|
128
168
|
```
|
|
169
|
+
|
|
170
|
+
### Control tag order for first-write column order (InfluxDB 3 Enterprise)
|
|
171
|
+
```python
|
|
172
|
+
from influxdb_client_3 import InfluxDBClient3, Point, WriteOptions, WriteType, write_client_options
|
|
173
|
+
|
|
174
|
+
point = Point("cpu") \
|
|
175
|
+
.tag("host", "server-a") \
|
|
176
|
+
.tag("region", "us-east") \
|
|
177
|
+
.tag("rack", "r1") \
|
|
178
|
+
.field("usage", 0.42)
|
|
179
|
+
|
|
180
|
+
write_options = WriteOptions(
|
|
181
|
+
write_type=WriteType.synchronous,
|
|
182
|
+
tag_order=["region", "host"],
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
client = InfluxDBClient3(
|
|
186
|
+
token="your-token",
|
|
187
|
+
host="your-host",
|
|
188
|
+
database="your-database",
|
|
189
|
+
write_client_options=write_client_options(write_options=write_options),
|
|
190
|
+
)
|
|
191
|
+
client.write(point)
|
|
192
|
+
```
|
|
129
193
|
### Using Line Protocol
|
|
130
194
|
```python
|
|
131
195
|
point = "measurement fieldname=0"
|
|
@@ -228,6 +292,56 @@ client.write_dataframe(
|
|
|
228
292
|
)
|
|
229
293
|
```
|
|
230
294
|
|
|
295
|
+
### Accept partial writes and inspect failed lines
|
|
296
|
+
`accept_partial` defaults to `True` and allows partial success when writing through the V3 API endpoint (`use_v2_api=False`) and a batch contains invalid lines.
|
|
297
|
+
On partial failure, the client raises `InfluxDBPartialWriteError` with structured `line_errors`.
|
|
298
|
+
|
|
299
|
+
```python
|
|
300
|
+
from influxdb_client_3 import InfluxDBClient3
|
|
301
|
+
from influxdb_client_3.exceptions import InfluxDBPartialWriteError
|
|
302
|
+
|
|
303
|
+
client = InfluxDBClient3(
|
|
304
|
+
host="http://localhost:8181",
|
|
305
|
+
token="token",
|
|
306
|
+
database="db",
|
|
307
|
+
write_use_v2_api=False,
|
|
308
|
+
)
|
|
309
|
+
lp = "home,room=Sunroom temp=96 1735545600\nhome,room=Sunroom temp=\"hi\" 1735549200"
|
|
310
|
+
|
|
311
|
+
try:
|
|
312
|
+
client.write(lp) # accept_partial=True by default on V3 API endpoint
|
|
313
|
+
except InfluxDBPartialWriteError as e:
|
|
314
|
+
for line_err in e.line_errors:
|
|
315
|
+
print(f"line {line_err.line_number} failed: {line_err.error_message} ({line_err.original_line})")
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Disable partial writes:
|
|
319
|
+
```python
|
|
320
|
+
client = InfluxDBClient3(
|
|
321
|
+
host="http://localhost:8181",
|
|
322
|
+
token="token",
|
|
323
|
+
database="db",
|
|
324
|
+
write_use_v2_api=False,
|
|
325
|
+
write_accept_partial=False,
|
|
326
|
+
)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Compatibility with InfluxDB Clustered and InfluxDB Cloud Dedicated/Serverless
|
|
330
|
+
Writes use the V2 API endpoint by default, so no additional configuration is required for these products.
|
|
331
|
+
|
|
332
|
+
`use_v2_api` can be configured by:
|
|
333
|
+
- `WriteOptions(use_v2_api=False)` (for V3 API endpoint features)
|
|
334
|
+
- constructor kwarg: `write_use_v2_api=False`
|
|
335
|
+
- env var: `INFLUX_WRITE_USE_V2_API=false`
|
|
336
|
+
|
|
337
|
+
When `use_v2_api=True`:
|
|
338
|
+
- `accept_partial` is not used
|
|
339
|
+
- `no_sync=True` is invalid and rejected before dispatch with:
|
|
340
|
+
`invalid write options: no_sync cannot be used with use_v2_api`
|
|
341
|
+
|
|
342
|
+
To use `no_sync` or `accept_partial` controls, set `use_v2_api=False`
|
|
343
|
+
(for example with InfluxDB 3 Core/Enterprise).
|
|
344
|
+
|
|
231
345
|
## Querying
|
|
232
346
|
|
|
233
347
|
### Querying with SQL
|
|
@@ -47,12 +47,52 @@ You can install 'influxdb3-python' using `pip`:
|
|
|
47
47
|
pip install influxdb3-python
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()
|
|
50
|
+
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()`, or to use PyArrow data conversion methods with nanosecond timestamp precision, you will need to install `pandas` separately.
|
|
51
51
|
|
|
52
|
-
*Note: Please make sure you are using 3.
|
|
52
|
+
*Note: Please make sure you are using 3.9 or above. For the best performance use 3.11+*
|
|
53
|
+
|
|
54
|
+
## CLI (Agent-Friendly Query Tool)
|
|
55
|
+
|
|
56
|
+
This package includes an `influx3` CLI for read/query workflows.
|
|
57
|
+
|
|
58
|
+
### Run a query
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
influx3 query -d my_database "SELECT * FROM cpu LIMIT 5"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
By default, output is JSON to stdout.
|
|
65
|
+
|
|
66
|
+
### Supported formats
|
|
67
|
+
|
|
68
|
+
- `json` (default)
|
|
69
|
+
- `jsonl`
|
|
70
|
+
- `csv`
|
|
71
|
+
- `pretty`
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
influx3 query -d my_database --format csv "SELECT * FROM cpu LIMIT 5"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Config precedence
|
|
78
|
+
|
|
79
|
+
Configuration values are resolved in this order:
|
|
80
|
+
|
|
81
|
+
1. CLI flags
|
|
82
|
+
2. `INFLUXDB3_*` environment variables
|
|
83
|
+
3. legacy `INFLUX_*` environment variables
|
|
84
|
+
4. built-in defaults (host defaults to `http://127.0.0.1:8181`)
|
|
85
|
+
|
|
86
|
+
Relevant environment variables:
|
|
87
|
+
|
|
88
|
+
- `INFLUXDB3_HOST_URL` (legacy fallback: `INFLUX_HOST`)
|
|
89
|
+
- `INFLUXDB3_DATABASE_NAME` (legacy fallback: `INFLUX_DATABASE`)
|
|
90
|
+
- `INFLUXDB3_AUTH_TOKEN` (legacy fallback: `INFLUX_TOKEN`)
|
|
53
91
|
|
|
54
92
|
# Usage
|
|
55
|
-
One of the easiest ways to get started is to
|
|
93
|
+
One of the easiest ways to get started is to check out the ["Influxdb3 Python Basic Usage"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/examples/jupyter/basic-write-query.ipynb) notebook. This scenario takes you through the core write and read APIs of the client library.
|
|
94
|
+
|
|
95
|
+
Additional examples independent of jupyter are detailed in the [`./examples`](./examples/README.md) directory.
|
|
56
96
|
|
|
57
97
|
## Importing the Module
|
|
58
98
|
```python
|
|
@@ -77,6 +117,30 @@ You can write data using the Point class, or supplying line protocol.
|
|
|
77
117
|
point = Point("measurement").tag("location", "london").field("temperature", 42)
|
|
78
118
|
client.write(point)
|
|
79
119
|
```
|
|
120
|
+
|
|
121
|
+
### Control tag order for first-write column order (InfluxDB 3 Enterprise)
|
|
122
|
+
```python
|
|
123
|
+
from influxdb_client_3 import InfluxDBClient3, Point, WriteOptions, WriteType, write_client_options
|
|
124
|
+
|
|
125
|
+
point = Point("cpu") \
|
|
126
|
+
.tag("host", "server-a") \
|
|
127
|
+
.tag("region", "us-east") \
|
|
128
|
+
.tag("rack", "r1") \
|
|
129
|
+
.field("usage", 0.42)
|
|
130
|
+
|
|
131
|
+
write_options = WriteOptions(
|
|
132
|
+
write_type=WriteType.synchronous,
|
|
133
|
+
tag_order=["region", "host"],
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
client = InfluxDBClient3(
|
|
137
|
+
token="your-token",
|
|
138
|
+
host="your-host",
|
|
139
|
+
database="your-database",
|
|
140
|
+
write_client_options=write_client_options(write_options=write_options),
|
|
141
|
+
)
|
|
142
|
+
client.write(point)
|
|
143
|
+
```
|
|
80
144
|
### Using Line Protocol
|
|
81
145
|
```python
|
|
82
146
|
point = "measurement fieldname=0"
|
|
@@ -179,6 +243,56 @@ client.write_dataframe(
|
|
|
179
243
|
)
|
|
180
244
|
```
|
|
181
245
|
|
|
246
|
+
### Accept partial writes and inspect failed lines
|
|
247
|
+
`accept_partial` defaults to `True` and allows partial success when writing through the V3 API endpoint (`use_v2_api=False`) and a batch contains invalid lines.
|
|
248
|
+
On partial failure, the client raises `InfluxDBPartialWriteError` with structured `line_errors`.
|
|
249
|
+
|
|
250
|
+
```python
|
|
251
|
+
from influxdb_client_3 import InfluxDBClient3
|
|
252
|
+
from influxdb_client_3.exceptions import InfluxDBPartialWriteError
|
|
253
|
+
|
|
254
|
+
client = InfluxDBClient3(
|
|
255
|
+
host="http://localhost:8181",
|
|
256
|
+
token="token",
|
|
257
|
+
database="db",
|
|
258
|
+
write_use_v2_api=False,
|
|
259
|
+
)
|
|
260
|
+
lp = "home,room=Sunroom temp=96 1735545600\nhome,room=Sunroom temp=\"hi\" 1735549200"
|
|
261
|
+
|
|
262
|
+
try:
|
|
263
|
+
client.write(lp) # accept_partial=True by default on V3 API endpoint
|
|
264
|
+
except InfluxDBPartialWriteError as e:
|
|
265
|
+
for line_err in e.line_errors:
|
|
266
|
+
print(f"line {line_err.line_number} failed: {line_err.error_message} ({line_err.original_line})")
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Disable partial writes:
|
|
270
|
+
```python
|
|
271
|
+
client = InfluxDBClient3(
|
|
272
|
+
host="http://localhost:8181",
|
|
273
|
+
token="token",
|
|
274
|
+
database="db",
|
|
275
|
+
write_use_v2_api=False,
|
|
276
|
+
write_accept_partial=False,
|
|
277
|
+
)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Compatibility with InfluxDB Clustered and InfluxDB Cloud Dedicated/Serverless
|
|
281
|
+
Writes use the V2 API endpoint by default, so no additional configuration is required for these products.
|
|
282
|
+
|
|
283
|
+
`use_v2_api` can be configured by:
|
|
284
|
+
- `WriteOptions(use_v2_api=False)` (for V3 API endpoint features)
|
|
285
|
+
- constructor kwarg: `write_use_v2_api=False`
|
|
286
|
+
- env var: `INFLUX_WRITE_USE_V2_API=false`
|
|
287
|
+
|
|
288
|
+
When `use_v2_api=True`:
|
|
289
|
+
- `accept_partial` is not used
|
|
290
|
+
- `no_sync=True` is invalid and rejected before dispatch with:
|
|
291
|
+
`invalid write options: no_sync cannot be used with use_v2_api`
|
|
292
|
+
|
|
293
|
+
To use `no_sync` or `accept_partial` controls, set `use_v2_api=False`
|
|
294
|
+
(for example with InfluxDB 3 Core/Enterprise).
|
|
295
|
+
|
|
182
296
|
## Querying
|
|
183
297
|
|
|
184
298
|
### Querying with SQL
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: influxdb3-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Community Python client for InfluxDB 3.0
|
|
5
5
|
Home-page: https://github.com/InfluxCommunity/influxdb3-python
|
|
6
6
|
Author: InfluxData
|
|
@@ -8,13 +8,13 @@ Author-email: contact@influxdata.com
|
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: reactivex>=4.0.4
|
|
@@ -96,12 +96,52 @@ You can install 'influxdb3-python' using `pip`:
|
|
|
96
96
|
pip install influxdb3-python
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()
|
|
99
|
+
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()`, or to use PyArrow data conversion methods with nanosecond timestamp precision, you will need to install `pandas` separately.
|
|
100
100
|
|
|
101
|
-
*Note: Please make sure you are using 3.
|
|
101
|
+
*Note: Please make sure you are using 3.9 or above. For the best performance use 3.11+*
|
|
102
|
+
|
|
103
|
+
## CLI (Agent-Friendly Query Tool)
|
|
104
|
+
|
|
105
|
+
This package includes an `influx3` CLI for read/query workflows.
|
|
106
|
+
|
|
107
|
+
### Run a query
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
influx3 query -d my_database "SELECT * FROM cpu LIMIT 5"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
By default, output is JSON to stdout.
|
|
114
|
+
|
|
115
|
+
### Supported formats
|
|
116
|
+
|
|
117
|
+
- `json` (default)
|
|
118
|
+
- `jsonl`
|
|
119
|
+
- `csv`
|
|
120
|
+
- `pretty`
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
influx3 query -d my_database --format csv "SELECT * FROM cpu LIMIT 5"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Config precedence
|
|
127
|
+
|
|
128
|
+
Configuration values are resolved in this order:
|
|
129
|
+
|
|
130
|
+
1. CLI flags
|
|
131
|
+
2. `INFLUXDB3_*` environment variables
|
|
132
|
+
3. legacy `INFLUX_*` environment variables
|
|
133
|
+
4. built-in defaults (host defaults to `http://127.0.0.1:8181`)
|
|
134
|
+
|
|
135
|
+
Relevant environment variables:
|
|
136
|
+
|
|
137
|
+
- `INFLUXDB3_HOST_URL` (legacy fallback: `INFLUX_HOST`)
|
|
138
|
+
- `INFLUXDB3_DATABASE_NAME` (legacy fallback: `INFLUX_DATABASE`)
|
|
139
|
+
- `INFLUXDB3_AUTH_TOKEN` (legacy fallback: `INFLUX_TOKEN`)
|
|
102
140
|
|
|
103
141
|
# Usage
|
|
104
|
-
One of the easiest ways to get started is to
|
|
142
|
+
One of the easiest ways to get started is to check out the ["Influxdb3 Python Basic Usage"](https://github.com/InfluxCommunity/influxdb3-python/blob/main/examples/jupyter/basic-write-query.ipynb) notebook. This scenario takes you through the core write and read APIs of the client library.
|
|
143
|
+
|
|
144
|
+
Additional examples independent of jupyter are detailed in the [`./examples`](./examples/README.md) directory.
|
|
105
145
|
|
|
106
146
|
## Importing the Module
|
|
107
147
|
```python
|
|
@@ -126,6 +166,30 @@ You can write data using the Point class, or supplying line protocol.
|
|
|
126
166
|
point = Point("measurement").tag("location", "london").field("temperature", 42)
|
|
127
167
|
client.write(point)
|
|
128
168
|
```
|
|
169
|
+
|
|
170
|
+
### Control tag order for first-write column order (InfluxDB 3 Enterprise)
|
|
171
|
+
```python
|
|
172
|
+
from influxdb_client_3 import InfluxDBClient3, Point, WriteOptions, WriteType, write_client_options
|
|
173
|
+
|
|
174
|
+
point = Point("cpu") \
|
|
175
|
+
.tag("host", "server-a") \
|
|
176
|
+
.tag("region", "us-east") \
|
|
177
|
+
.tag("rack", "r1") \
|
|
178
|
+
.field("usage", 0.42)
|
|
179
|
+
|
|
180
|
+
write_options = WriteOptions(
|
|
181
|
+
write_type=WriteType.synchronous,
|
|
182
|
+
tag_order=["region", "host"],
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
client = InfluxDBClient3(
|
|
186
|
+
token="your-token",
|
|
187
|
+
host="your-host",
|
|
188
|
+
database="your-database",
|
|
189
|
+
write_client_options=write_client_options(write_options=write_options),
|
|
190
|
+
)
|
|
191
|
+
client.write(point)
|
|
192
|
+
```
|
|
129
193
|
### Using Line Protocol
|
|
130
194
|
```python
|
|
131
195
|
point = "measurement fieldname=0"
|
|
@@ -228,6 +292,56 @@ client.write_dataframe(
|
|
|
228
292
|
)
|
|
229
293
|
```
|
|
230
294
|
|
|
295
|
+
### Accept partial writes and inspect failed lines
|
|
296
|
+
`accept_partial` defaults to `True` and allows partial success when writing through the V3 API endpoint (`use_v2_api=False`) and a batch contains invalid lines.
|
|
297
|
+
On partial failure, the client raises `InfluxDBPartialWriteError` with structured `line_errors`.
|
|
298
|
+
|
|
299
|
+
```python
|
|
300
|
+
from influxdb_client_3 import InfluxDBClient3
|
|
301
|
+
from influxdb_client_3.exceptions import InfluxDBPartialWriteError
|
|
302
|
+
|
|
303
|
+
client = InfluxDBClient3(
|
|
304
|
+
host="http://localhost:8181",
|
|
305
|
+
token="token",
|
|
306
|
+
database="db",
|
|
307
|
+
write_use_v2_api=False,
|
|
308
|
+
)
|
|
309
|
+
lp = "home,room=Sunroom temp=96 1735545600\nhome,room=Sunroom temp=\"hi\" 1735549200"
|
|
310
|
+
|
|
311
|
+
try:
|
|
312
|
+
client.write(lp) # accept_partial=True by default on V3 API endpoint
|
|
313
|
+
except InfluxDBPartialWriteError as e:
|
|
314
|
+
for line_err in e.line_errors:
|
|
315
|
+
print(f"line {line_err.line_number} failed: {line_err.error_message} ({line_err.original_line})")
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Disable partial writes:
|
|
319
|
+
```python
|
|
320
|
+
client = InfluxDBClient3(
|
|
321
|
+
host="http://localhost:8181",
|
|
322
|
+
token="token",
|
|
323
|
+
database="db",
|
|
324
|
+
write_use_v2_api=False,
|
|
325
|
+
write_accept_partial=False,
|
|
326
|
+
)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Compatibility with InfluxDB Clustered and InfluxDB Cloud Dedicated/Serverless
|
|
330
|
+
Writes use the V2 API endpoint by default, so no additional configuration is required for these products.
|
|
331
|
+
|
|
332
|
+
`use_v2_api` can be configured by:
|
|
333
|
+
- `WriteOptions(use_v2_api=False)` (for V3 API endpoint features)
|
|
334
|
+
- constructor kwarg: `write_use_v2_api=False`
|
|
335
|
+
- env var: `INFLUX_WRITE_USE_V2_API=false`
|
|
336
|
+
|
|
337
|
+
When `use_v2_api=True`:
|
|
338
|
+
- `accept_partial` is not used
|
|
339
|
+
- `no_sync=True` is invalid and rejected before dispatch with:
|
|
340
|
+
`invalid write options: no_sync cannot be used with use_v2_api`
|
|
341
|
+
|
|
342
|
+
To use `no_sync` or `accept_partial` controls, set `use_v2_api=False`
|
|
343
|
+
(for example with InfluxDB 3 Core/Enterprise).
|
|
344
|
+
|
|
231
345
|
## Querying
|
|
232
346
|
|
|
233
347
|
### Querying with SQL
|
|
@@ -2,26 +2,15 @@ LICENSE
|
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
4
|
setup.py
|
|
5
|
-
Examples/__init__.py
|
|
6
|
-
Examples/basic_ssl_example.py
|
|
7
|
-
Examples/batching_example.py
|
|
8
|
-
Examples/cloud_dedicated_query.py
|
|
9
|
-
Examples/cloud_dedicated_write.py
|
|
10
|
-
Examples/config.py
|
|
11
|
-
Examples/flight_options_example.py
|
|
12
|
-
Examples/handle_http_error.py
|
|
13
|
-
Examples/handle_query_error.py
|
|
14
|
-
Examples/pandas_write.py
|
|
15
|
-
Examples/query_async.py
|
|
16
|
-
Examples/query_type.py
|
|
17
|
-
Examples/query_with_middleware.py
|
|
18
|
-
Examples/timeouts.py
|
|
19
5
|
influxdb3_python.egg-info/PKG-INFO
|
|
20
6
|
influxdb3_python.egg-info/SOURCES.txt
|
|
21
7
|
influxdb3_python.egg-info/dependency_links.txt
|
|
8
|
+
influxdb3_python.egg-info/entry_points.txt
|
|
22
9
|
influxdb3_python.egg-info/requires.txt
|
|
23
10
|
influxdb3_python.egg-info/top_level.txt
|
|
24
11
|
influxdb_client_3/__init__.py
|
|
12
|
+
influxdb_client_3/__main__.py
|
|
13
|
+
influxdb_client_3/cli.py
|
|
25
14
|
influxdb_client_3/py.typed
|
|
26
15
|
influxdb_client_3/read_file.py
|
|
27
16
|
influxdb_client_3/version.py
|
|
@@ -33,6 +22,7 @@ influxdb_client_3/write_client/__init__.py
|
|
|
33
22
|
influxdb_client_3/write_client/configuration.py
|
|
34
23
|
influxdb_client_3/write_client/extras.py
|
|
35
24
|
influxdb_client_3/write_client/rest.py
|
|
25
|
+
influxdb_client_3/write_client/write_defaults.py
|
|
36
26
|
influxdb_client_3/write_client/_sync/__init__.py
|
|
37
27
|
influxdb_client_3/write_client/_sync/api_client.py
|
|
38
28
|
influxdb_client_3/write_client/_sync/rest.py
|
|
@@ -57,10 +47,9 @@ influxdb_client_3/write_client/domain/write_precision.py
|
|
|
57
47
|
influxdb_client_3/write_client/domain/write_precision_converter.py
|
|
58
48
|
influxdb_client_3/write_client/service/__init__.py
|
|
59
49
|
influxdb_client_3/write_client/service/_base_service.py
|
|
60
|
-
influxdb_client_3/write_client/service/signin_service.py
|
|
61
|
-
influxdb_client_3/write_client/service/signout_service.py
|
|
62
50
|
influxdb_client_3/write_client/service/write_service.py
|
|
63
51
|
tests/test_api_client.py
|
|
52
|
+
tests/test_cli.py
|
|
64
53
|
tests/test_dataframe_serializer.py
|
|
65
54
|
tests/test_date_helper.py
|
|
66
55
|
tests/test_deep_merge.py
|
|
@@ -29,6 +29,8 @@ INFLUX_PRECISION = "INFLUX_PRECISION"
|
|
|
29
29
|
INFLUX_AUTH_SCHEME = "INFLUX_AUTH_SCHEME"
|
|
30
30
|
INFLUX_GZIP_THRESHOLD = "INFLUX_GZIP_THRESHOLD"
|
|
31
31
|
INFLUX_WRITE_NO_SYNC = "INFLUX_WRITE_NO_SYNC"
|
|
32
|
+
INFLUX_WRITE_ACCEPT_PARTIAL = "INFLUX_WRITE_ACCEPT_PARTIAL"
|
|
33
|
+
INFLUX_WRITE_USE_V2_API = "INFLUX_WRITE_USE_V2_API"
|
|
32
34
|
INFLUX_WRITE_TIMEOUT = "INFLUX_WRITE_TIMEOUT"
|
|
33
35
|
INFLUX_QUERY_TIMEOUT = "INFLUX_QUERY_TIMEOUT"
|
|
34
36
|
INFLUX_DISABLE_GRPC_COMPRESSION = "INFLUX_DISABLE_GRPC_COMPRESSION"
|
|
@@ -155,19 +157,19 @@ def _parse_gzip_threshold(threshold: str) -> int:
|
|
|
155
157
|
return threshold
|
|
156
158
|
|
|
157
159
|
|
|
158
|
-
def
|
|
160
|
+
def _parse_write_bool(value):
|
|
159
161
|
"""
|
|
160
|
-
Parses
|
|
162
|
+
Parses a truthy/falsy value for write options.
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
The input is normalized to string and matched against common truthy values.
|
|
165
|
+
Any non-truthy value is treated as False.
|
|
164
166
|
|
|
165
|
-
:param
|
|
166
|
-
:type
|
|
167
|
-
:return:
|
|
167
|
+
:param value: The input value to be parsed and validated.
|
|
168
|
+
:type value: Any
|
|
169
|
+
:return: Parsed boolean value.
|
|
168
170
|
:rtype: bool
|
|
169
171
|
"""
|
|
170
|
-
return
|
|
172
|
+
return str(value).strip().lower() in ['true', '1', 't', 'y', 'yes']
|
|
171
173
|
|
|
172
174
|
|
|
173
175
|
def _parse_timeout(to: str) -> int:
|
|
@@ -226,13 +228,11 @@ class InfluxDBClient3:
|
|
|
226
228
|
Defaults to "multiprocessing.cpu_count() * 5".
|
|
227
229
|
:key urllib3.util.retry.Retry retries: Set the default retry strategy that is used for all HTTP requests
|
|
228
230
|
except batching writes. As a default there is no one retry strategy.
|
|
229
|
-
:key bool auth_basic: Set this to true to enable basic authentication when talking to a InfluxDB 1.8.x that
|
|
230
|
-
does not use auth-enabled but is protected by a reverse proxy with basic authentication.
|
|
231
|
-
(defaults to false, don't set to true when talking to InfluxDB 2)
|
|
232
|
-
:key str username: ``username`` to authenticate via username and password credentials to the InfluxDB 2.x
|
|
233
|
-
:key str password: ``password`` to authenticate via username and password credentials to the InfluxDB 2.x
|
|
234
231
|
:key str query_timeout: int value used to set the client query API timeout in milliseconds.
|
|
235
232
|
:key str write_timeout: int value used to set the client write API timeout in milliseconds.
|
|
233
|
+
:key bool write_accept_partial: allow partial writes when some lines fail.
|
|
234
|
+
:key bool write_use_v2_api: route writes through /api/v2/write compatibility endpoint.
|
|
235
|
+
:key bool write_no_sync: disable sync confirmation on V3 API endpoint writes.
|
|
236
236
|
:key list[str] profilers: list of enabled Flux profilers
|
|
237
237
|
"""
|
|
238
238
|
self._org = org if org is not None else "default"
|
|
@@ -243,6 +243,8 @@ class InfluxDBClient3:
|
|
|
243
243
|
write_type = DefaultWriteOptions.write_type.value
|
|
244
244
|
write_precision = DefaultWriteOptions.write_precision.value
|
|
245
245
|
write_no_sync = DefaultWriteOptions.no_sync.value
|
|
246
|
+
write_accept_partial = DefaultWriteOptions.accept_partial.value
|
|
247
|
+
write_use_v2_api = DefaultWriteOptions.use_v2_api.value
|
|
246
248
|
write_timeout = DefaultWriteOptions.timeout.value
|
|
247
249
|
|
|
248
250
|
if isinstance(write_client_options, dict) and write_client_options.get('write_options') is not None:
|
|
@@ -250,15 +252,28 @@ class InfluxDBClient3:
|
|
|
250
252
|
write_type = getattr(write_opts, 'write_type', write_type)
|
|
251
253
|
write_precision = getattr(write_opts, 'write_precision', write_precision)
|
|
252
254
|
write_no_sync = getattr(write_opts, 'no_sync', write_no_sync)
|
|
255
|
+
write_accept_partial = getattr(write_opts, 'accept_partial', write_accept_partial)
|
|
256
|
+
write_use_v2_api = getattr(write_opts, 'use_v2_api', write_use_v2_api)
|
|
253
257
|
write_timeout = getattr(write_opts, 'timeout', write_timeout)
|
|
254
258
|
|
|
255
259
|
if kw_keys.__contains__('write_timeout'):
|
|
256
260
|
write_timeout = kwargs.get('write_timeout')
|
|
257
261
|
|
|
262
|
+
if kw_keys.__contains__('write_accept_partial') and kwargs.get('write_accept_partial') is not None:
|
|
263
|
+
write_accept_partial = _parse_write_bool(kwargs.get('write_accept_partial'))
|
|
264
|
+
|
|
265
|
+
if kw_keys.__contains__('write_use_v2_api') and kwargs.get('write_use_v2_api') is not None:
|
|
266
|
+
write_use_v2_api = _parse_write_bool(kwargs.get('write_use_v2_api'))
|
|
267
|
+
|
|
268
|
+
if kw_keys.__contains__('write_no_sync') and kwargs.get('write_no_sync') is not None:
|
|
269
|
+
write_no_sync = _parse_write_bool(kwargs.get('write_no_sync'))
|
|
270
|
+
|
|
258
271
|
write_options = WriteOptions(
|
|
259
272
|
write_type=write_type,
|
|
260
273
|
write_precision=write_precision,
|
|
261
274
|
no_sync=write_no_sync,
|
|
275
|
+
accept_partial=write_accept_partial,
|
|
276
|
+
use_v2_api=write_use_v2_api,
|
|
262
277
|
)
|
|
263
278
|
|
|
264
279
|
self._write_client_options = {
|
|
@@ -347,7 +362,15 @@ class InfluxDBClient3:
|
|
|
347
362
|
|
|
348
363
|
write_no_sync = os.getenv(INFLUX_WRITE_NO_SYNC)
|
|
349
364
|
if write_no_sync is not None:
|
|
350
|
-
write_options.no_sync =
|
|
365
|
+
write_options.no_sync = _parse_write_bool(write_no_sync)
|
|
366
|
+
|
|
367
|
+
write_accept_partial = os.getenv(INFLUX_WRITE_ACCEPT_PARTIAL)
|
|
368
|
+
if write_accept_partial is not None:
|
|
369
|
+
write_options.accept_partial = _parse_write_bool(write_accept_partial)
|
|
370
|
+
|
|
371
|
+
write_use_v2_api = os.getenv(INFLUX_WRITE_USE_V2_API)
|
|
372
|
+
if write_use_v2_api is not None:
|
|
373
|
+
write_options.use_v2_api = _parse_write_bool(write_use_v2_api)
|
|
351
374
|
|
|
352
375
|
precision = os.getenv(INFLUX_PRECISION)
|
|
353
376
|
if precision is not None:
|
|
@@ -388,6 +411,11 @@ class InfluxDBClient3:
|
|
|
388
411
|
"""
|
|
389
412
|
Write data to InfluxDB.
|
|
390
413
|
|
|
414
|
+
Warning: When you write with only one Point or one Dict, and If that Point or Dict
|
|
415
|
+
contains fields with None value, those fields will not be written to InfluxDB.
|
|
416
|
+
If such fields are later queried explicitly, for example,
|
|
417
|
+
"SELECT field_with_value, field_with_null_value FROM my_table" an error will be thrown.
|
|
418
|
+
|
|
391
419
|
:param record: The data point(s) to write.
|
|
392
420
|
:type record: object or list of objects
|
|
393
421
|
:param database: The database to write to. If not provided, uses the database provided during initialization.
|
|
@@ -397,10 +425,7 @@ class InfluxDBClient3:
|
|
|
397
425
|
if database is None:
|
|
398
426
|
database = self._database
|
|
399
427
|
|
|
400
|
-
|
|
401
|
-
return self._write_api.write(bucket=database, record=record, **kwargs)
|
|
402
|
-
except InfluxDBError as e:
|
|
403
|
-
raise e
|
|
428
|
+
return self._write_api.write(bucket=database, record=record, **kwargs)
|
|
404
429
|
|
|
405
430
|
def write_dataframe(
|
|
406
431
|
self,
|