Repository navigation
Clear all 16 mypy errors in record_keeper.py (#431 session 3) - #440
Merged
Merged
Conversation
Two distinct fixes:
- `folder_stats: Dict[str, FolderStats] = {}`: the per-folder rollup
accumulator mixes int, float, and List[float] values in one dict
literal, which mypy widened to "object" -- producing a cascade of
"object has no attribute append", "Unsupported operand types for +",
and "No overload variant of sum/max/round matches" errors everywhere
the accumulated stats get consumed. Added a FolderStats TypedDict
declaring each field's real type instead. Resolved 15 of 16.
- `ai_score`: first assigned as a bare float (from `float(str(...))`
or a `0.0` fallback), then later reassigned to None in the
zero_dependency_mode branch -- that None is intentional (record_keeper
already maps bypassed zero-dep metrics to real SQL NULL rather than
0.0, specifically to avoid an unavailable metric looking like a
measured "zero risk" in the database -- see e7e1acf). Annotated
`Optional[float]` at first assignment instead of changing the None.
pagerank_score/blast_radius/betweenness_score/closeness_score/
producer_ratio/ecosystem_role already infer Optional[float] cleanly
from the same if/else with no prior binding, so they needed no change.
173 -> 157 unique baseline entries. Regenerated in the minimal
mypy-audit.yml environment per #436's lesson.
Verified: record_keeper.py reports zero mypy errors after this change.
flake8, dead_key_audit.py --ci, full pytest suite (866 passed,
1 deselected, 1 pre-existing xfail) all clean.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #429/#431, one file per session. This session: `record_keeper.py`.
Two distinct fixes:
173 → 157 unique baseline entries.
Test plan