From 8c2775c13aa3f8223f73d80106e52a02a0a4f77d Mon Sep 17 00:00:00 2001 From: MattBrth <36452374+MattBrth@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:13:30 +0100 Subject: [PATCH] refactor(dataframe): avoid chained assignment in replace operation --- CHANGELOG.md | 1 + influxdb_client/client/write/dataframe_serializer.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1bf2187..856beb89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +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. ## 1.40.0 [2024-01-30] diff --git a/influxdb_client/client/write/dataframe_serializer.py b/influxdb_client/client/write/dataframe_serializer.py index 6c028716..98262526 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[k].replace('', np.nan, inplace=True) + data_frame.replace({k: ''}, np.nan, inplace=True) self.data_frame = data_frame self.f = f pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy