-
Notifications
You must be signed in to change notification settings - Fork 185
Query stops when encountering a field containing a string (query_csv) #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Olgidos, thanks for using our client. Can you share a You can also use Regards |
I am now using:
Output:
Receiving still 7 out of 9 data sets When using the method from "expected behavior":
Receiving 9 out of 9 data sets |
Can you share also the response HTTP body? It looks like related to your data... Can you also update to latest client version? |
how can I access the http body or are you talking about the print out from my code? |
the print out from your code |
So I updated the lib Here is the data output for debug = True and .query_csv
When I remove the debug = True, I get my normal output back, which is not present with the debug flag:
It seems like the http body receives the string but it is then not included in the csv list
|
The
It looks like that the csv_parser is not able to parse multiple tables in response - https://docs.influxdata.com/influxdb/v2.5/reference/syntax/annotated-csv/. As a workaround you can add |
ok
is there another way not using .query_csv; at the start I tested .query, which however was much slower then .query_csv; |
Just add
The You can also iterate over response by something like: response = query_api.query_raw('from(bucket:"my-bucket") |> range(start: -10m)',
dialect=Dialect(header=True, annotations=[]))
response.data.splitlines()
for line in response.data.splitlines():
print(codecs.decode(line).split(',')) |
Hi @Olgidos, the problem is caused by the response from InfluxDB because the response contains empty lines. Your code contains if(len(row) < 2 ):
break
print(row) this breaks the loop if the row is an empty line. Instead of if(len(row) < 2 ):
continue
print(row) I will prepare PR that improve our handling of empty lines. Regards |
thanks! :) |
Specifications
Code sample to reproduce problem
Expected behavior
When I query this online, I get 9 tables. 7 of them have doubles/ints and 2 strings as _value. The same works when I query the above using python and the following code:
Actual behavior
However when I query with
I get only 7 tables without any error. The two strings are not present anymore
Additional info
No response
The text was updated successfully, but these errors were encountered: