chore: fix mypy union assignment issues
What does this merge request do and why?
mypy
does not know which type is used in a union return. This change
ensures we explicit assert the type and remove the linting errors (union-attr
).
How to set up and validate locally
- Observe the errors by running the follow command.
poetry run mypy tests/code_suggestions/models/test_mock.py
- Check out to this merge request's branch.
- Confirm the errors no longer shows.
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Edited by Tan Le