influxdata / influxdb-client-python

InfluxDB 2.0 python client
https://influxdb-client.readthedocs.io/en/stable/
MIT License
724 stars 187 forks source link

Deprecated warning when write DataFrame #610

Closed xxjjvxb closed 1 year ago

xxjjvxb commented 1 year ago

Specifications

Code sample to reproduce problem

using none-value fields with pandas dataframe

Expected behavior

Stop showing Future warning.

such as

[influxdb_client\client\write\dataframe_serializer.py:200](file:///C:/git_space/temp/practice_analyzer/.venv/Lib/site-packages/influxdb_client/client/write/dataframe_serializer.py:200): FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  if null_columns[index]:
[influxdb_client\client\write\dataframe_serializer.py:176](file:///C:/git_space/temp/practice_analyzer/.venv/Lib/site-packages/influxdb_client/client/write/dataframe_serializer.py:176): FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  if null_columns[index]:
[influxdb_client\client\write\dataframe_serializer.py:205](file:///C:/git_space/temp/practice_analyzer/.venv/Lib/site-packages/influxdb_client/client/write/dataframe_serializer.py:205): FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  if null_columns[index]:
[influxdb_client\client\write\dataframe_serializer.py:242](file:///C:/git_space/temp/practice_analyzer/.venv/Lib/site-packages/influxdb_client/client/write/dataframe_serializer.py:242): FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  self.first_field_maybe_null = null_columns[field_indexes[0] - 1]
[influxdb_client\client\write\dataframe_serializer.py:176](file:///C:/git_space/temp/practice_analyzer/.venv/Lib/site-packages/influxdb_client/client/write/dataframe_serializer.py:176): FutureWarning: Series.

Actual behavior

put 'iloc'

Additional info

No response