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

Update type-hints #2159

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Update type-hints #2159

wants to merge 4 commits into from

Conversation

JohnVillalovos
Copy link
Member

chore: correct type-hints for participants() method

The participants() method returns a list of dictionaries. Update the
type-hints for it.

chore: correct type-hints for http_get/http_post derived values

The methods http_get() and http_post() can also return a list.
Update the code to handle that case.

Closes: #2158

@JohnVillalovos JohnVillalovos marked this pull request as draft July 21, 2022 04:21
@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2022

Codecov Report

Merging #2159 (00b3e26) into main (9833632) will decrease coverage by 0.01%.
The diff coverage is 96.42%.

@@            Coverage Diff             @@
##             main    #2159      +/-   ##
==========================================
- Coverage   95.42%   95.40%   -0.02%     
==========================================
  Files          79       79              
  Lines        5198     5206       +8     
==========================================
+ Hits         4960     4967       +7     
- Misses        238      239       +1     
Flag Coverage Δ
api_func_v4 81.29% <91.07%> (-0.03%) ⬇️
cli_func_v4 82.75% <83.92%> (-0.04%) ⬇️
unit 87.11% <96.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/objects/groups.py 88.96% <ø> (-0.08%) ⬇️
gitlab/v4/objects/repositories.py 83.07% <ø> (ø)
gitlab/mixins.py 92.07% <50.00%> (-0.24%) ⬇️
gitlab/base.py 99.51% <100.00%> (+<0.01%) ⬆️
gitlab/cli.py 100.00% <100.00%> (ø)
gitlab/client.py 98.72% <100.00%> (+0.01%) ⬆️
gitlab/v4/objects/commits.py 94.80% <100.00%> (-0.07%) ⬇️
gitlab/v4/objects/deploy_keys.py 96.42% <100.00%> (ø)
gitlab/v4/objects/environments.py 100.00% <100.00%> (ø)
gitlab/v4/objects/merge_requests.py 84.78% <100.00%> (-0.11%) ⬇️
... and 4 more

@JohnVillalovos JohnVillalovos force-pushed the jlvillal/find_non_dict branch 9 times, most recently from bf02f9e to d4c2b57 Compare July 23, 2022 07:10
Update code so that the `warn_return_any` check passes.
The methods `http_get()` and `http_post()` can also return a `list`.
Update the code to handle that case.

Closes: #2158
The `participants()` method returns a list of dictionaries. Update the
type-hints for it.
The functions return Optional[bool].

Add tests for their behavior
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

Successfully merging this pull request may close these issues.

Need to update type annotations for http_* methods
2 participants