diff options
author | John Villalovos <john@sodarock.com> | 2022-06-27 12:53:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 21:53:49 +0200 |
commit | 212ddfc9e9c5de50d2507cc637c01ceb31aaba41 (patch) | |
tree | c5a0a92cb72b1886567330381e8ba5a277efb45d /gitlab/mixins.py | |
parent | ebd579588d05966ee66cce014b141e6ab39435cc (diff) | |
download | gitlab-212ddfc9e9c5de50d2507cc637c01ceb31aaba41.tar.gz |
refactor: avoid possible breaking change in iterator (#2107)
Commit b6447211754e126f64e12fc735ad74fe557b7fb4 inadvertently
introduced a possible breaking change as it added a new argument
`iterator` and added it in between existing (potentially positional) arguments.
This moves the `iterator` argument to the end of the argument list and
requires it to be a keyword-only argument.
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 3c897d4..519e83f 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -613,9 +613,10 @@ class DownloadMixin(_RestObjectBase): def download( self, streamed: bool = False, - iterator: bool = False, action: Optional[Callable] = None, chunk_size: int = 1024, + *, + iterator: bool = False, **kwargs: Any, ) -> Optional[Union[bytes, Iterator[Any]]]: """Download the archive of a resource export. @@ -644,7 +645,9 @@ class DownloadMixin(_RestObjectBase): ) if TYPE_CHECKING: assert isinstance(result, requests.Response) - return utils.response_content(result, streamed, iterator, action, chunk_size) + return utils.response_content( + result, streamed, action, chunk_size, iterator=iterator + ) class SubscribableMixin(_RestObjectBase): |