Skip to content

Commit aa6e5c4

Browse files
authored
fix: DataFrame write shows Future Warning. (influxdata#611)
1 parent 1ec64b7 commit aa6e5c4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
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. [#601](https://github.com/influxdata/influxdb-client-python/pull/601): Use HTTResponse.headers to clear deprecation warning [urllib3]
5+
1. [#610](https://github.com/influxdata/influxdb-client-python/pull/601): Use iloc to clear deprecation warning
56

67
### Documentation
78
1. [#566](https://github.com/influxdata/influxdb-client-python/pull/566): Fix Sphinx documentation build and add support `.readthedocs.yml` V2 configuration file

influxdb_client/client/write/dataframe_serializer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
173173

174174
if key in data_frame_tag_columns:
175175
# This column is a tag column.
176-
if null_columns[index]:
176+
if null_columns.iloc[index]:
177177
key_value = f"""{{
178178
'' if {val_format} == '' or type({val_format}) == float and math.isnan({val_format}) else
179179
f',{key_format}={{str({val_format}).translate(_ESCAPE_STRING)}}'
@@ -197,12 +197,12 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
197197
elif issubclass(value.type, np.bool_):
198198
field_value = f'{sep}{key_format}={{{val_format}}}'
199199
elif issubclass(value.type, np.floating):
200-
if null_columns[index]:
200+
if null_columns.iloc[index]:
201201
field_value = f"""{{"" if math.isnan({val_format}) else f"{sep}{key_format}={{{val_format}}}"}}"""
202202
else:
203203
field_value = f'{sep}{key_format}={{{val_format}}}'
204204
else:
205-
if null_columns[index]:
205+
if null_columns.iloc[index]:
206206
field_value = f"""{{
207207
'' if type({val_format}) == float and math.isnan({val_format}) else
208208
f'{sep}{key_format}="{{str({val_format}).translate(_ESCAPE_STRING)}}"'
@@ -239,7 +239,7 @@ def __init__(self, data_frame, point_settings, precision=DEFAULT_WRITE_PRECISION
239239
self.data_frame = data_frame
240240
self.f = f
241241
self.field_indexes = field_indexes
242-
self.first_field_maybe_null = null_columns[field_indexes[0] - 1]
242+
self.first_field_maybe_null = null_columns.iloc[field_indexes[0] - 1]
243243

244244
#
245245
# prepare chunks

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