Fix mypy type errors in pool-coordinator services and API wiring#29
Merged
Merged
Conversation
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.
Motivation
mypyacross the pool-coordinator package to ensure safer, clearer API surfaces and service logic.Any/incompatible-type issues at type-check time.Description
stream_handlerand keepJsonFormatterusage consistent inconfigure_loggingto avoid handler type inference issues inpool-coordinator/app/core/logging.py.cosine_similarityreturn afloatexplicitly instead of an untyped value to removeAnyinference inpool-coordinator/app/services/verification.py.DailyEmissionStatus(TypedDict) and annotateget_daily_emission_statusto return it, and use the typedremaining_tokensvalue safely inrun_daily_emissioninpool-coordinator/app/services/emission.py.Decimal, numeric, or string inputs and fallback toDecimal("0")for invalid types to avoidDecimal(object)errors inpool-coordinator/app/services/emission.py.require_rolesand annotate FastAPI middlewaredispatchandlifespansignatures for better static checking inpool-coordinator/app/api/dependencies/auth.pyandpool-coordinator/app/main.py.Testing
mypy appinsidepool-coordinatorand confirmed success:Success: no issues found in 44 source files.Codex Task