Skip to content

Commit

Permalink
fix(python): unmatched paren and influxql syntax: (#6832)
Browse files Browse the repository at this point in the history
* fix(python): unmatched paren and influxql syntax:

- Remove unmatched closing paren.
- Remove quotes from InfluxQL duration. Durations aren't strings. If using SQL, the interval expression ('10 minutes') would be a string.

* fix(python):  Double quote table in influxql syntax:

- When quoting the table (measurement) name, use double quotes. Single quotes don't work.
  • Loading branch information
jstirnaman authored Oct 30, 2023
1 parent 5ca2e71 commit 63139c5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export const ExecuteAggregateQuerySql = (props: OwnProps) => {
const {bucket} = props

const sqlSnippet = `SELECT mean(count)
FROM 'census'
WHERE time > now() - '10m'`
FROM "census"
WHERE time > now() - 10m`

const querySnippet = `query = """SELECT mean(count)
FROM 'census'
WHERE time > now() - '10m'"""
FROM "census"
WHERE time > now() - 10m"""
# Execute the query
table = client.query(query=query, database="${bucket}", language='influxql') )
table = client.query(query=query, database="${bucket}", language="influxql")
# Convert to dataframe
df = table.to_pandas().sort_values(by="time")
Expand Down

0 comments on commit 63139c5

Please sign in to comment.