You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transferring data types (numeric, object etc.) to dataframe
Expected behavior:
Returning the data types of the data pulled from the database with query_api as it should be.
Actual behavior:
When I use the following query with the query_data_frame module in the query_api, all columns except _time are returned as objects; even though the data stored in the database is not string.
query_api = influxdb_client.query_api()bucket, measurement, start, stop ="test", "test", "0", "now()"query = 'import \"influxdata/influxdb/schema\"' \ f' from(bucket:\"{bucket}\")' \ f' |> range(start: {start}, stop: {stop})' \ f' |> filter(fn: (r) => r._measurement == \"{measurement}\")' \ f' |> drop(columns: ["_start", "_stop","_measurement"])' \ f' |> schema.fieldsAsCols()'result = query_api.query_data_frame(query=query)print(result.dtypes)_time datetime64[ns, UTC]attribute_1 objectattribute_2 objectattribute_3 object
When I transform the data with the code below, I can see that the data is numeric, not object. The data which is saved in the database is as follows:
Steps to reproduce:
Expected behavior:
Returning the data types of the data pulled from the database with query_api as it should be.
Actual behavior:
When I use the following query with the query_data_frame module in the query_api, all columns except _time are returned as objects; even though the data stored in the database is not string.
When I transform the data with the code below, I can see that the data is numeric, not object. The data which is saved in the database is as follows:
Specifications:
The text was updated successfully, but these errors were encountered: