Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing types #1430

Closed
lavigne958 opened this issue Mar 1, 2024 · 2 comments · Fixed by #1483
Closed

Add missing types #1430

lavigne958 opened this issue Mar 1, 2024 · 2 comments · Fixed by #1483
Assignees
Labels
in progress Issue currently in progress by the assignee
Milestone

Comments

@lavigne958
Copy link
Collaborator

Overview

Add missing typing in code, all function arguments + return values should be typed.

Details

We found some parts of the code that is not typed, all arguments and all returned values should be typed.

If possible we can try to type the tests too ! it would help while developing tests to have some auto-completion too.

@lavigne958 lavigne958 added this to the 6.2.0 milestone Mar 2, 2024
@lavigne958 lavigne958 added the in progress Issue currently in progress by the assignee label Mar 28, 2024
lavigne958 added a commit that referenced this issue Apr 1, 2024
ref: #1430

Signed-off-by: Alexandre Lavigne <[email protected]>
lavigne958 added a commit that referenced this issue Apr 1, 2024
ref: #1430

Signed-off-by: Alexandre Lavigne <[email protected]>
lavigne958 added a commit that referenced this issue Apr 1, 2024
ref: #1430

Signed-off-by: Alexandre Lavigne <[email protected]>
@lavigne958
Copy link
Collaborator Author

add JSON typing using: https://github.com/kevinheavey/jsonalias

@lavigne958
Copy link
Collaborator Author

I tried to type the low level HTTP methods using the JSON type provided and it does not work.
Any time we return some JSON type, we try to access the data as a dict or a list etc and mypy complains and says:
the return value could be a str, or a dict or a list and str object have no method __getitem__ (which is true).
So it can't make the link: we return some value with multiple types possible we use as one of the possible type.

let's keep the Any for now. we don't have a better solution.

I'll type the test so it helps any rich test editor to auto-complete and that would do for now I suppose.

@lavigne958 lavigne958 removed the in progress Issue currently in progress by the assignee label Apr 16, 2024
@lavigne958 lavigne958 added the in progress Issue currently in progress by the assignee label Jun 17, 2024
@lavigne958 lavigne958 self-assigned this Jun 17, 2024
lavigne958 added a commit that referenced this issue Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Issue currently in progress by the assignee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant