8000 docs: add deprecation warning for `WriteType.asynchronous` (#499) · matt-VR/influxdb-client-python@81f3e84 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81f3e84

Browse files
authored
docs: add deprecation warning for WriteType.asynchronous (influxdata#499)
1 parent a1c2615 commit 81f3e84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

influxdb_client/client/write_api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# coding: utf-8
44
import logging
55
import os
6+
import warnings
67
from collections import defaultdict
78
from datetime import timedelta
89
from enum import Enum
@@ -273,6 +274,14 @@ def __init__(self,
273274
self._subject = None
274275
self._disposable = None
275276

277+
if self._write_options.write_type is WriteType.asynchronous:
278+
message = """The 'WriteType.asynchronous' is deprecated and will be removed in future major version.
279+
280+
You can use native asynchronous version of the client:
281+
- https://influxdb-client.readthedocs.io/en/stable/usage.html#how-to-use-asyncio
282+
"""
283+
warnings.warn(message, DeprecationWarning)
284+
276285
def write(self, bucket: str, org: str = None,
277286
record: Union[
278287
str, Iterable['str'], Point, Iterable['Point'], dict, Iterable['dict'], bytes, Iterable['bytes'],

0 commit comments

Comments
 (0)
0