Skip to content

Commit 2d91db5

Browse files
authored
refactor(dataframe): avoid chained assignment in replace operation (influxdata#638)
1 parent 7a5f655 commit 2d91db5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### Bug Fixes
44
1. [#636](https://github.com/influxdata/influxdb-client-python/pull/636): Handle missing data in data frames
5+
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.
56

67
## 1.40.0 [2024-01-30]
78

influxdb_client/client/write/dataframe_serializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
234234

235235
for k, v in dict(data_frame.dtypes).items():
236236
if k in data_frame_tag_columns:
237-
data_frame[k].replace('', np.nan, inplace=True)
237+
data_frame.replace({k: ''}, np.nan, inplace=True)
238238

239239
self.data_frame = data_frame
240240
self.f = f

0 commit comments

Comments
 (0)
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