-
Notifications
You must be signed in to change notification settings - Fork 675
feat(client): introduce iterator=True and deprecate as_list=False in list()
#2032
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
Conversation
7825972 to
c678721
Compare
c678721 to
b4ae128
Compare
Codecov Report
@@ Coverage Diff @@
## main #2032 +/- ##
==========================================
- Coverage 92.72% 92.71% -0.02%
==========================================
Files 78 78
Lines 4947 4953 +6
==========================================
+ Hits 4587 4592 +5
- Misses 360 361 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
nejch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @JohnVillalovos just a few minor comments.
Context for future readers:
https://github.com/python-gitlab/python-gitlab/pull/1956/files#r884302316
… in `list()` `as_list=False` is confusing as it doesn't explain what is being returned. Replace it with `iterator=True` which more clearly explains to the user that an iterator/generator will be returned. This maintains backward compatibility with `as_list` but does issue a DeprecationWarning if `as_list` is set.
b4ae128 to
cdc6605
Compare
list() change as_list=False to iterator=Trueiterator=True and deprecate as_list=False in list()
nejch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JohnVillalovos, makes sense to me, also makes it consistent with the iterator arg on the upcoming streaming responses PR then.
as_list=Falseis confusing as it doesn't explain what is beingreturned. Replace it with
iterator=Truewhich more clearly explainsto the user that an iterator/generator will be returned.
This maintains backward compatibility with
as_listbut does issue aDeprecationWarning if
as_listis set.