@@ -857,7 +857,7 @@ def http_list(
857
857
Returns:
858
858
A list of the objects returned by the server. If `iterator` is
859
859
True and no pagination-related arguments (`page`, `per_page`,
860
- `all `) are defined then a GitlabList object (generator) is returned
860
+ `get_all `) are defined then a GitlabList object (generator) is returned
861
861
instead. This object will make API calls when needed to fetch the
862
862
next items from the server.
863
863
@@ -884,7 +884,13 @@ def http_list(
884
884
category = DeprecationWarning ,
885
885
)
886
886
887
- get_all = kwargs .pop ("all" , None )
887
+ # Provide a `get_all`` param to avoid clashes with `all` API attributes.
888
+ get_all = kwargs .pop ("get_all" , None )
889
+
890
+ if get_all is None :
891
+ # For now, keep `all` without deprecation.
892
+ get_all = kwargs .pop ("all" , None )
893
+
888
894
url = self ._build_url (path )
889
895
890
896
page = kwargs .get ("page" )
@@ -902,7 +908,7 @@ def http_list(
902
908
903
909
def should_emit_warning () -> bool :
904
910
# No warning is emitted if any of the following conditions apply:
905
- # * `all =False` was set in the `list()` call.
911
+ # * `get_all =False` was set in the `list()` call.
906
912
# * `page` was set in the `list()` call.
907
913
# * GitLab did not return the `x-per-page` header.
908
914
# * Number of items received is less than per-page value.
@@ -927,12 +933,12 @@ def should_emit_warning() -> bool:
927
933
total_items = "many" if gl_list .total is None else gl_list .total
928
934
utils .warn (
929
935
message = (
930
- f"Calling a `list()` method without specifying `all =True` or "
936
+ f"Calling a `list()` method without specifying `get_all =True` or "
931
937
f"`iterator=True` will return a maximum of { gl_list .per_page } items. "
932
938
f"Your query returned { len (items )} of { total_items } items. See "
933
939
f"{ _PAGINATION_URL } for more details. If this was done intentionally, "
934
940
f"then this warning can be supressed by adding the argument "
935
- f"`all =False` to the `list()` call."
941
+ f"`get_all =False` to the `list()` call."
936
942
),
937
943
category = UserWarning ,
938
944
)
0 commit comments