This repository was archived by the owner on Sep 3, 2025. It is now read-only.
chore(typing): modernizes codebase to use Python 3.9+ built-in types#5965
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the codebase to leverage built‐in type annotations and generic types introduced in recent Python versions. Key changes include replacing typing.Optional and typing.List with the union operator (|) and built‐in generics (e.g. list[..]), and updating function signatures in service, model, view, and helper modules accordingly.
Reviewed Changes
Copilot reviewed 169 out of 169 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/dispatch/data/alert/service.py | Updated return types from Optional to Alert |
| src/dispatch/data/alert/models.py | Converted Optional and List types to union types and built‐in generics |
| src/dispatch/cost_model/service.py | Changed List returns to list[...] using the new built‐in generics |
| src/dispatch/conversation/service.py | Updated function return annotations from Optional to union type |
| src/dispatch/config.py | Converted typing.List parameter in get_env_tags to list[...] |
| src/dispatch/conference/service.py | Updated return types from Optional to union types |
| src/dispatch/conference/flows.py | Modernized list parameters in function signatures |
| src/dispatch/case_cost_type/service.py | Updated function return types from Optional to union types |
| src/dispatch/case_cost_type/models.py | Replaced Optional types with union types for better consistency |
| src/dispatch/case_cost/service.py | Updated various return types from List[Optional[...]] to list[...] |
| src/dispatch/case_cost/models.py | Converted Optional and List annotations to union and built‐in generics |
| src/dispatch/case/views.py | Changed response_model annotations to use built‐in list types |
| src/dispatch/case/type/service.py | Replaced Optional with union types in function signatures |
| src/dispatch/case/severity/service.py | Updated return types to use union types |
| src/dispatch/case/service.py | Modernized nearly all Optional and List type hints in service functions |
| src/dispatch/case/priority/service.py | Updated function annotations with the new union operator |
ghost
approved these changes
May 8, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.