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

Open
lavigne958 opened this issue Mar 1, 2024 · 2 comments
Open

Add missing types #1430

lavigne958 opened this issue Mar 1, 2024 · 2 comments
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 <lavigne958@gmail.com>
lavigne958 added a commit that referenced this issue Apr 1, 2024
ref: #1430

Signed-off-by: Alexandre Lavigne <lavigne958@gmail.com>
lavigne958 added a commit that referenced this issue Apr 1, 2024
ref: #1430

Signed-off-by: Alexandre Lavigne <lavigne958@gmail.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant