Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

FutureWarning on frame.append method #920

Open
lothesven opened this issue Jul 25, 2022 · 0 comments
Open

FutureWarning on frame.append method #920

lothesven opened this issue Jul 25, 2022 · 0 comments

Comments

@lothesven
Copy link

  • 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant