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

bug: bind_params cause InfluxDBClientError: expected field argument #913

Open
CunjunYin opened this issue Jan 6, 2022 · 1 comment
Open

Comments

@CunjunYin
Copy link

  • **InfluxDB version:1.24.0
  • **InfluxDB-python version: 5.3.1
  • **Python version: 3.8.5
  • **Operating system version: Ubuntu 20.04

sample query
client.query(query='SELECT mean( $var ) FROM "TABLE" WHERE time > $peroid GROUP BY time(10m) fill(0);', bind_params ={"var": name, "peroid":time })

ERROR: InfluxDBClientError: expected field argument in mean()

when replace $var with name everything works fine
client.query(query='SELECT mean( "NAME" ) FROM "TABLE" WHERE time > $peroid GROUP BY time(10m) fill(0);', bind_params ={"var": name, "peroid":time })

@DrakezulsMinimalism
Copy link

bind_params is (AFAIK) only supported in the WHERE-clause, not in the SELECT.
You might have to add specific field-validation instead of using bind_params for that.

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

2 participants