Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

FutureWarning on frame.append method #920

@lothesven

Description

@lothesven
  • InfluxDB version: e.g. 1.7.7 (output of the influx version command)
  • InfluxDB-python version: e.g. 5.2.2 (output of the python -c "from __future__ import print_function; import influxdb; print(influxdb.__version__)" command)
  • Python version: e.g. 3.7.4 (output of the python --version command)
  • Operating system version: e.g. Windows 10, Ubuntu 18.04, macOS 10.14.5

Here is the code:

`client = influxdb_client.InfluxDBClient( url = self.url,
token = self.token,
org = self.org,
timeout = self.timeout,
verify_ssl=False)

query_api = client.query_api()

now = dt.datetime.now(tz=dt.timezone.utc)
stringTimeStart = now - dt.timedelta(minutes=1)
stringTimeStart = stringTimeStart.replace(second=0, microsecond=0)
stringTimeStop = now # - dt.timedelta(hours=0)
stringTimeStop = stringTimeStop.replace(second=0, microsecond=0)

query = '''
from(bucket: "my-bucket")
|> range(start: {stringTimeStart}, stop: {stringTimeStop})
|> filter(fn: (r) => r["_measurement"] == "MeasureName")
|> filter(fn: (r) => r["_field"] == "xDef" or r["_field"] == "xDef1" or r["_field"] == "xDef2" or r["_field"] == "xDef3")
|> keep(columns: ["_time", "_field", "_value"])
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
'''

query = query.format(stringTimeStart=stringTimeStart.isoformat(), stringTimeStop=stringTimeStop.isoformat())
self.last_states = query_api.query_data_frame(query = query)`

Here is the problematic output message :

/home/user/.local/lib/python3.9/site-packages/influxdb_client/client/flux_csv_parser.py:191: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. return self._data_frame.append(_temp_df)

The script is working properly for now but I am afraid it could be disrupted in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      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