style(baseline): typehint call-return locals in CalculatorRebaseliner

PR feedback: annotate locals assigned from a method-call return or
attribute access, even though pyright infers them — the type is visible at
the assignment without chasing the callee. `result: SapResult` and
`sap_version: Optional[float]` in rebaseline(). Local annotations are not
evaluated at runtime, so the TYPE_CHECKING-only SapResult import stands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-06-02 13:49:34 +00:00
parent bce4a9f7ec
commit 389e39012d

View file

@ -59,8 +59,8 @@ class CalculatorRebaseliner(Rebaseliner):
) -> tuple[Performance, RebaselineReason]:
# A raise (UnmappedSapCode, etc.) propagates: the calculator is
# load-bearing, so the batch aborts and the cert is fixed at once.
result = self._calculator.calculate(effective_epc)
sap_version = effective_epc.sap_version
result: SapResult = self._calculator.calculate(effective_epc)
sap_version: Optional[float] = effective_epc.sap_version
if sap_version is not None and sap_version < _SAP10_2_FLOOR:
return performance_from_sap_result(result), "pre_sap10"
self._log_divergence(