Skip to content

Commit b839f93

Browse files
committed
ci: enforce make lint and fix the three violations it was hiding
The job named `lint-and-format-check` only ever ran `make format`, so ruff's linter was never enforced anywhere except pre-commit -- which runs on changed files only. Three violations reached master as a result, and `make lint` has been failing on a clean checkout. Fixes all three, then adds the missing step so the job does what its name says: - sse_client.py `_is_retryable_exc` ended with an `if isinstance(...): return True` / `return False` pair (SIM103). Collapsed to returning the isinstance directly; the comment explaining why RemoteProtocolError is retryable moves above the return and is unchanged. - test_agentic_runner.py imported `AGENTIC_TEST_KINDS` and `AgenticEvalOutcome` inside two test bodies (PLC0415, twice). Both names were already imported at module top -- `AgenticEvalOutcome` identically, `AGENTIC_TEST_KINDS` from a module the file already imports from -- so the local imports were redundant, not deliberate deferrals. Removed, and AGENTIC_TEST_KINDS added to the existing top-level import. No behaviour change: the isinstance chain returns the same value for every input, and the moved imports resolve to the same objects. jira: trivial risk: low
1 parent a1b29d9 commit b839f93

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

‎.github/workflows/rw-python-tests.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
- name: pep8 and formatting check
4545
run: |
4646
make format
47+
- name: lint check
48+
run: |
49+
make lint
4750
docs-scripts-tests:
4851
runs-on: ubuntu-latest
4952
if: ${{inputs.changed-python-modules == 'true'}}

‎packages/gooddata-eval/src/gooddata_eval/core/chat/sse_client.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ def _is_retryable_exc(exc: Exception) -> bool:
8989
return True
9090
if isinstance(exc, httpx.HTTPStatusError):
9191
return exc.response.status_code in _RETRYABLE_STATUS_CODES
92-
if isinstance(exc, httpx.RemoteProtocolError):
93-
# Mid-stream disconnect ("peer closed connection without sending complete
94-
# message body") -- pure network flake, not a real agent/content failure.
95-
# Confirmed live: contaminated ~1-4% of visualization runs with a hard
96-
# fail and zero retry attempts.
97-
return True
98-
return False
92+
# Mid-stream disconnect ("peer closed connection without sending complete
93+
# message body") -- pure network flake, not a real agent/content failure.
94+
# Confirmed live: contaminated ~1-4% of visualization runs with a hard
95+
# fail and zero retry attempts.
96+
return isinstance(exc, httpx.RemoteProtocolError)
9997

10098

10199
def _retry_transient(operation: Callable[[], T], *, is_retryable: Callable[[Exception], bool]) -> T:

‎packages/gooddata-eval/tests/test_agentic_runner.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from unittest.mock import patch
44

55
import pytest
6-
from gooddata_eval.cli.agentic_runner import _dispatch_agentic, run_agentic_items
6+
from gooddata_eval.cli.agentic_runner import AGENTIC_TEST_KINDS, _dispatch_agentic, run_agentic_items
77
from gooddata_eval.core.agentic.alert_skill import AlertSkillAssertionError
88
from gooddata_eval.core.models import AgenticEvalOutcome, DatasetItem
99

@@ -81,8 +81,6 @@ def test_all_agentic_kind_cases_covers_every_registered_kind():
8181
"""Guards the two parametrized tests below against silently going stale: a kind added
8282
to AGENTIC_TEST_KINDS without a matching case here would otherwise just not get tested,
8383
not fail loudly."""
84-
from gooddata_eval.cli.agentic_runner import AGENTIC_TEST_KINDS
85-
8684
covered = {kind for kind, _, _ in _ALL_AGENTIC_KIND_CASES}
8785
assert covered == set(AGENTIC_TEST_KINDS)
8886

@@ -194,8 +192,6 @@ def test_dispatch_agentic_returns_a_real_outcome_for_every_kind(kind, expected_o
194192
evaluator produced -- not None, not the outcome's reasoning_steps list alone, not any
195193
other bare value the old `isinstance(outcome, tuple)`/`isinstance(outcome, AgenticEvalOutcome)`
196194
fallback could silently swallow."""
197-
from gooddata_eval.core.models import AgenticEvalOutcome
198-
199195
item = DatasetItem(
200196
id="q1",
201197
dataset_name="ds",

0 commit comments

Comments
 (0)