-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`pyright` was reporting the following issues: ``` pg_backup_api/server_operation.py:512:16 - error: Expression of type "tuple[str | bytearray | memoryview, int | Any]" cannot be assigned to return type "Tuple[str | None, int]" (reportGeneralTypeIssues) pg_backup_api/utils.py pg_backup_api/utils.py:101:37 - error: Cannot access member "server_names" for type "None" Member "server_names" is unknown (reportGeneralTypeIssues) pg_backup_api/utils.py:102:34 - error: Cannot access member "get_server" for type "None" Member "get_server" is unknown (reportGeneralTypeIssues) pg_backup_api/utils.py:107:36 - error: "server" is not a known member of module "barman" (reportGeneralTypeIssues) pg_backup_api/logic/utility_controller.py pg_backup_api/logic/utility_controller.py:57:33 - error: Cannot access member "server_names" for type "None" Member "server_names" is unknown (reportGeneralTypeIssues) pg_backup_api/logic/utility_controller.py:61:34 - error: Cannot access member "get_server" for type "None" Member "get_server" is unknown (reportGeneralTypeIssues) pg_backup_api/logic/utility_controller.py:69:37 - error: Cannot access member "servers_msg_list" for type "None" Member "servers_msg_list" is unknown (reportGeneralTypeIssues) pg_backup_api/logic/utility_controller.py:217:39 - error: "id" is not a known member of "None" (reportOptionalMemberAccess) ``` This commit fixes those issues by asserting that the variables are instances of the expected types. Note: we had to add `pyright: ignore` to a couple lines because `barman` doesn't have type hints, otherwise `pyright` would keep complaining about `Unknown` here in `pg-backup-api`. References: BAR-133. Signed-off-by: Israel Barth Rubio <[email protected]>
- Loading branch information
1 parent
e660f0d
commit fb056d5
Showing
3 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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