我正试图使用以下代码通过panda从Influx数据库中查询数据:
from influxdb_client import InfluxDBClient
import pandas as pd
my_token = "my_token"
my_org = "my_org"
bucket = "bucket"
query= '''
from(bucket: "bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "measurement")
|> filter(fn: (r) => r["_field"] == "count")
|> filter(fn: (r) => r["unit"] == "unit")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")'''
username = 'username'
password = 'password'
client = InfluxDBClient(url="https://us-west-2-1.aws.cloud2.influxdata.com/", token=f'{username}:{password}', org='my_org')
system_stats = client.query_api().query_data_frame(org=my_org, query=query)
执行完以上操作后,我得到一个错误:
ApiException: (0) Reason: SSLError [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)
我不熟悉Influx数据库,但我需要查询一些数据并创建一个数据帧。我使用的语法正确吗?我应该如何解决这个问题?非常感谢。