Skip to content

Commit aeeb3c6

Browse files
peekjef72amotl
authored andcommitted
dsquery: fix historical queries methods
1 parent 90fcc82 commit aeeb3c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

grafana_client/elements/datasource.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ def smartquery(self, datasource: Union[DatasourceIdentifier, Dict], expression:
370370
send_request = self.client.GET
371371

372372
elif datasource_type in ("prometheus", "loki") and LooseVersion(self.api.version) <= VERSION_7:
373-
if request["data"]["format"] != "table":
373+
if "queries" in request["data"] and len(request["data"]["queries"]) > 0 \
374+
and "instant" in request["data"]["queries"][0] and request["data"]["queries"][0]["instant"]:
374375
return self.query(
375376
datasource.get("id"),
376377
request["expr"],

0 commit comments

Comments
 (0)