Update python.md (#3679)

* Update python.md
Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
pull/3681/head^2
Grace Ma 2022-01-13 15:16:22 -08:00 committed by GitHub
parent b7347c8974
commit 774316cced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -110,14 +110,14 @@ write_api.write(bucket=bucket, org=org, record=p)
query_api = client.query_api()
```
2. Create a Flux query.
2. Create a Flux query, and then format it as a Python string.
```python
query = from(bucket:"my-bucket")\
query = ' from(bucket:"my-bucket")\
|> range(start: -10m)\
|> filter(fn:(r) => r._measurement == "my_measurement")\
|> filter(fn: (r) => r.location == "Prague")\
|> filter(fn:(r) => r._field == "temperature" )
|> filter(fn:(r) => r._field == "temperature" ) '
```
The query client sends the Flux query to InfluxDB and returns a Flux object with a table structure.