FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: avoid passing redundant arguments to API by nejch · Pull Request #1965 · python-gitlab/python-gitlab · GitHub

Repository navigation

fix: avoid passing redundant arguments to API - #1965

Merged
max-wittig merged 1 commit into
mainfrom
fix/redundant-args-api
Apr 14, 2022
Merged

max-wittig merged 1 commit into
mainfrom
fix/redundant-args-api

Conversation

nejch commented Apr 4, 2022

Copy link
Copy Markdown
Member

Closes #987.

This was already fixed in b9ecc9a but partially reintroduced with the global retry_transient_errors feature.

Copy link
Copy Markdown

Codecov Report

Merging #1965 (3431887) into main (0353bd4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1965   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files          78       78           
  Lines        4909     4910    +1     
=======================================
+ Hits         4544     4545    +1     
  Misses        365      365           
Flag Coverage Δ
cli_func_v4 81.58% <100.00%> (+<0.01%) ⬆️
py_func_v4 80.12% <100.00%> (+<0.01%) ⬆️
unit 83.48% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
gitlab/client.py 90.58% <100.00%> (+0.02%) ⬆️

nejch requested a review from JohnVillalovos April 5, 2022 07:19

Copy link
Copy Markdown
Member

@nejch Mhmm but where is that retry_transient_errors is actually removed. I just see that it's set as a self attribute.

nejch commented Apr 6, 2022

Copy link
Copy Markdown
Member Author

@nejch Mhmm but where is that retry_transient_errors is actually removed. I just see that it's set as a self attribute.

@max-wittig previously it would just get picked from the method's **kwargs via .get():

retry_transient_errors = kwargs.get(
"retry_transient_errors", self.retry_transient_errors
)

but all kwargs are passed as query parameters to the API because they're copied to params earlier:

utils.copy_dict(src=kwargs, dest=params)

I added it as an explicit argument to avoid that. I could have done.pop() from kwargs instead, but it would have to be done before that dict is copied, so I thought it'd be cleaner like this.

nejch assigned max-wittig and unassigned nejch Apr 6, 2022
nejch requested a review from max-wittig April 14, 2022 09:44
max-wittig merged commit ba7692a into main Apr 14, 2022
max-wittig deleted the fix/redundant-args-api branch April 14, 2022 17:36
This file contains hidden or 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
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.

Additional arguments are passed on to the API

3 participants


Back | FazBrowse Home | New Git URL