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
MissingPivotFunction: The query doesn't contains the pivot() function.
The result will not be shaped to optimal processing by pandas.DataFrame. Use the pivot() function by:
import "influxdata/influxdb/schema"
schema.measurementTagValues(
bucket: "monitors",
measurement: "temperature",
tag: "identifier",
)
|> distinct(column: "_value")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
Here:
The warning is not appropriate for the query
The suggested resolution is non-functional
The loudness of the warning means that the warning needs to be disabled entirely
If the warning does serve a purpose elsewhere in the codebase, then this problem eliminates that possibility. Personally, I don't think blindly checking for a pivot is the way to go here. There are other ways in which even regular queries can be constructed to return data frame friendly results, and the warning gives pause when a pause is not needed. I think leaving it to the user to look at the dataframe and reshape to get whatever is needed is perfectly acceptable, instead of the choice the library presently gives of :
a) forcing a pivot
b) forcing a potentially new user to deal with and take explicit measures to suppress a particularly loud warning
For reference, this is what the (unpivoted) reponse looks like:
Specifications
the last step prints a warning messages that provides a non-working solution. The solution does not apply to the returned table.
Code sample to reproduce problem
Expected behavior
Either the suggested solution should be correct, or no warning should be emitted.
Actual behavior
A solution is provided that does not apply to the returned table.
Additional info
No response
The text was updated successfully, but these errors were encountered: