From ed89701687cc03b86df6135d1b554e6676160030 Mon Sep 17 00:00:00 2001 From: Lars Nilse Date: Tue, 6 Feb 2024 07:49:01 +0100 Subject: [PATCH] fix: Pandas 3.0 warning for inplace method (#642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * silence pandas 3.0 warning * add to changelog * docs: Update CHANGELOG.md --------- Co-authored-by: Jakub Bednář --- CHANGELOG.md | 2 +- influxdb_client/client/write/dataframe_serializer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5b10565..e542413a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Bug Fixes 1. [#636](https://github.com/influxdata/influxdb-client-python/pull/636): Handle missing data in data frames -2. [#638](https://github.com/influxdata/influxdb-client-python/pull/638): Refactor DataFrame operations to avoid chained assignment and resolve FutureWarning in pandas, ensuring compatibility with pandas 3.0. +2. [#638](https://github.com/influxdata/influxdb-client-python/pull/638), [#642](https://github.com/influxdata/influxdb-client-python/pull/642): Refactor DataFrame operations to avoid chained assignment and resolve FutureWarning in pandas, ensuring compatibility with pandas 3.0. ### Documentation 1. [#639](https://github.com/influxdata/influxdb-client-python/pull/639): Use Markdown for `README` diff --git a/influxdb_client/client/write/dataframe_serializer.py b/influxdb_client/client/write/dataframe_serializer.py index 98262526..6121171f 100644 --- a/influxdb_client/client/write/dataframe_serializer.py +++ b/influxdb_client/client/write/dataframe_serializer.py @@ -234,7 +234,7 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION for k, v in dict(data_frame.dtypes).items(): if k in data_frame_tag_columns: - data_frame.replace({k: ''}, np.nan, inplace=True) + data_frame = data_frame.replace({k: ''}, np.nan) self.data_frame = data_frame self.f = f