From 218242eb0009c4fb610d6f17d9cffcb164e4a5d4 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Mon, 12 Sep 2022 14:00:16 +0200 Subject: [PATCH 1/2] docs: add deprecation warning for `WriteType.asynchronous` --- influxdb_client/client/write_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/influxdb_client/client/write_api.py b/influxdb_client/client/write_api.py index fbbba2e3..e4d083d1 100644 --- a/influxdb_client/client/write_api.py +++ b/influxdb_client/client/write_api.py @@ -3,6 +3,7 @@ # coding: utf-8 import logging import os +import warnings from collections import defaultdict from datetime import timedelta from enum import Enum @@ -273,6 +274,14 @@ def __init__(self, self._subject = None self._disposable = None + if self._write_options.write_type is WriteType.asynchronous: + message = f"""The 'WriteType.asynchronous' is deprecated and will be removed in future major version. + +You can use native asynchronous version of the client: +- https://influxdb-client.readthedocs.io/en/stable/usage.html#how-to-use-asyncio + """ + warnings.warn(message, DeprecationWarning) + def write(self, bucket: str, org: str = None, record: Union[ str, Iterable['str'], Point, Iterable['Point'], dict, Iterable['dict'], bytes, Iterable['bytes'], From 80b20a0b55fa82baaed064e6e85fccbd98e24a2d Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Mon, 12 Sep 2022 14:02:49 +0200 Subject: [PATCH 2/2] docs: add deprecation warning for `WriteType.asynchronous` --- influxdb_client/client/write_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/influxdb_client/client/write_api.py b/influxdb_client/client/write_api.py index e4d083d1..64fefb98 100644 --- a/influxdb_client/client/write_api.py +++ b/influxdb_client/client/write_api.py @@ -275,8 +275,8 @@ def __init__(self, self._disposable = None if self._write_options.write_type is WriteType.asynchronous: - message = f"""The 'WriteType.asynchronous' is deprecated and will be removed in future major version. - + message = """The 'WriteType.asynchronous' is deprecated and will be removed in future major version. + You can use native asynchronous version of the client: - https://influxdb-client.readthedocs.io/en/stable/usage.html#how-to-use-asyncio """