$__timeTo/ $__timeFrom / $__timeFilter not behaving correctly #123
Unanswered
countershane
asked this question in
Q&A
Replies: 1 comment
-
|
Also, to clarify, we tested with the $__timeFrom & $__timeTo without "()" and it still parsed the timestamp incorrectly and throws an error in databricks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I've recently installed the most recent plugin version on our Grafana instance (running v11.2.2) and having some issues with the way the macros are/aren't functioning.
firstly, the $__timeFilter macro wasn't being translated to between
this:
WHERE $__timeFilter(f.timestamp)
AND hf.timestamp BETWEEN ($__timeFrom()::timestamptz - INTERVAL '1 days') AND $__timeTo()
translated to this:
$__timeFilter(f.timestamp)
AND hf.timestamp BETWEEN (2025-08-13 10:03:19()::timestamptz - INTERVAL '1 days') AND FROM_UNIXTIME(1755165799)
So we just verbosely switched all logic to use "between" logic, but then databricks was still throwing errors.
it seems to come down to the way it's parsing out the timestamp from the macro, not as a string but as a cluster of integers. Specifically the error throws on the first piece of the hour in the datetime stamp: 2025-08-13 10:03:19
Probably we can solve it by wrapping the macros in parenthesis and single quotes, but really doesn't seem that should be necessary, as the documentation says it should be doing that natively.
This script is copied from another dashboard that was hitting postgres, and we could see that the postgres connector is working fine and translating the script properly
Anyone else have this problem?
Beta Was this translation helpful? Give feedback.
All reactions