Closed maparham closed 4 months ago
Hi @maparham,
Thank you for utilizing our client for your InfluxDB operations.
I noticed you're looking to ingest data that includes columns named result
and table
. Since these are reserved words within our system, used specifically for parsing data into Pandas DataFrames, you'll need to adjust your flux query to accommodate this.
You can tweak your flux query by renaming these columns within the query itself, ensuring that the reserved columns are not directly used. Here's an example of how you could modify your query to achieve this:
data_frames = query_api.query_data_frame(
'from(bucket:"my-bucket") '
"|> range(start: -100m) "
'|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value") '
'|> map(fn: (r) => ({r with table_value: r.table, result_value: r.result})) '
'|> drop(columns: ["table", "result"]) '
)
In this modified query, we use the map
function to create new columns (table_value
and result_value
) that contain the data from the table
and result
columns, respectively. Afterward, we remove the original table
and result
columns with the drop
function to avoid conflicts.
This approach allows you to retain all necessary data without conflicting with the reserved column names used during the DataFrame parsing process.
Should you have any further questions or need additional guidance, please don't hesitate to reach out.
Best Regards
Specifications
Code sample to reproduce problem
Expected behavior
Actual behavior
Additional info
No response