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
main currently fails both Ruff and the unit suite. Bisecting the recent merges
points at #444 (8612df20), and four PRs have merged on top since (#445, #449, #450, #451), so this has been red for a while.
Two separate problems, and they are independent — fixing one does not fix
the other:
Ruff F811 — _strip_promql_comments is both imported into panels.py
and defined locally in it.
I found this because an unrelated PR (#454) inherited the failure; I have not
changed anything here, because fixing (2) needs a call from the #440/#443
author about which behaviour is correct (see below).
F811 Redefinition of unused `_strip_promql_comments` from line 94
--> observability_migration/adapters/source/grafana/panels.py:1556:5
tests/test_grafana_issue_440_vector_matching.py::NativeEligibilityGateTests::
test_a_comment_between_the_matcher_and_its_parenthesis_does_not_hide_it
> self.assertFalse(can_use_native_promql(expr, runtime_features=CAPABLE))
E AssertionError: True is not false
Notes for whoever picks this up
The two are unrelated. I tried both directions of the duplicate definition
on a clean origin/main worktree:
change
ruff
#443 tests
#440 tests
remove the import at panels.py:94
clean
pass
still fail
remove the local def at panels.py:1556
clean
pass
still fail
So F811 is cosmetic — the local def shadows the import, and the two
implementations behave the same for this case. The #440 regression comes from
elsewhere in #444's changes (69 new lines in promql.py).
The #440 failure is a genuine judgement call, which is why I did not
"fix" it. Its test asserts that on # note\n(device) makes can_use_native_promql return False even for a capable target, reasoning in
its own comment that _clean_promql_for_native flattens the expression and
would fold the operand after the comment into it. #444's whole purpose was to
strip comments before structure is read — after which on # note\n(device)
becomes on \n(device) and flattens to valid on (device).
Both readings are defensible and they imply opposite fixes:
the gate is now right → #440's test and its rationale are stale and
should be updated;
Guessing wrong either suppresses a real test or emits broken native PROMQL, so
this wants the author of #440/#443 rather than a drive-by fix.
Possibly worth a separate look: four PRs merged onto a red main. If
required status checks are not enforced on main, that is arguably the more
important fix.
Commands and logs
See Reproduction above.
Environment
Python: 3.11 (CI) / 3.12 (local); reproduced on both
Kibana / Elasticsearch: n/a — offline lint and unit suite only
Summary
maincurrently fails both Ruff and the unit suite. Bisecting the recent mergespoints at #444 (
8612df20), and four PRs have merged on top since (#445,#449, #450, #451), so this has been red for a while.
Two separate problems, and they are independent — fixing one does not fix
the other:
F811—_strip_promql_commentsis both imported intopanels.pyand defined locally in it.
test_grafana_issue_440_vector_matchingfails (2 subtests) — the nativeeligibility gate now accepts an expression the Native PROMQL: support on()/ignoring()/group_* when the target supports vector matching #440 test expects it to
decline.
I found this because an unrelated PR (#454) inherited the failure; I have not
changed anything here, because fixing (2) needs a call from the #440/#443
author about which behaviour is correct (see below).
Source type
Reproduction
Bisect over the merges (each in its own clean worktree, same ruff 0.15.11):
#440subtest failuresa6772e208612df204dee8954cff3472bda10d74605b26e0aExpected behavior
mainpassesruff check .and the unit suite.Actual behavior
Notes for whoever picks this up
The two are unrelated. I tried both directions of the duplicate definition
on a clean
origin/mainworktree:#443tests#440testspanels.py:94panels.py:1556So
F811is cosmetic — the local def shadows the import, and the twoimplementations behave the same for this case. The
#440regression comes fromelsewhere in #444's changes (69 new lines in
promql.py).The
#440failure is a genuine judgement call, which is why I did not"fix" it. Its test asserts that
on # note\n(device)makescan_use_native_promqlreturnFalseeven for a capable target, reasoning inits own comment that
_clean_promql_for_nativeflattens the expression andwould fold the operand after the comment into it. #444's whole purpose was to
strip comments before structure is read — after which
on # note\n(device)becomes
on \n(device)and flattens to validon (device).Both readings are defensible and they imply opposite fixes:
#440's test and its rationale are stale andshould be updated;
path, and a capable target can now be handed a native PROMQL query that was
previously (deliberately) kept on ES|QL.
Guessing wrong either suppresses a real test or emits broken native PROMQL, so
this wants the author of #440/#443 rather than a drive-by fix.
Possibly worth a separate look: four PRs merged onto a red
main. Ifrequired status checks are not enforced on
main, that is arguably the moreimportant fix.
Commands and logs
See Reproduction above.
Environment