summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-02-03 13:18:40 -0800
committerJohn L. Villalovos <john@sodarock.com>2022-02-03 13:18:40 -0800
commit7cf35b2c0e44732ca02b74b45525cc7c789457fb (patch)
tree0c97eb35be08710974f253984e3ef1e41587e3a9 /gitlab
parent64d01ef23b1269b705350106d8ddc2962a780dce (diff)
downloadgitlab-7cf35b2c0e44732ca02b74b45525cc7c789457fb.tar.gz
chore: require kwargs for `utils.copy_dict()`
The non-keyword arguments were a tiny bit confusing as the destination was first and the source was second. Change the order and require key-word only arguments to ensure we don't silently break anyone.
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/client.py6
-rw-r--r--gitlab/utils.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/gitlab/client.py b/gitlab/client.py
index 46ddd9d..a4c5831 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -647,7 +647,7 @@ class Gitlab:
url = self._build_url(path)
params: Dict[str, Any] = {}
- utils.copy_dict(params, query_data)
+ utils.copy_dict(src=query_data, dest=params)
# Deal with kwargs: by default a user uses kwargs to send data to the
# gitlab server, but this generates problems (python keyword conflicts
@@ -656,12 +656,12 @@ class Gitlab:
# value as arguments for the gitlab server, and ignore the other
# arguments, except pagination ones (per_page and page)
if "query_parameters" in kwargs:
- utils.copy_dict(params, kwargs["query_parameters"])
+ utils.copy_dict(src=kwargs["query_parameters"], dest=params)
for arg in ("per_page", "page"):
if arg in kwargs:
params[arg] = kwargs[arg]
else:
- utils.copy_dict(params, kwargs)
+ utils.copy_dict(src=kwargs, dest=params)
opts = self._get_session_opts()
diff --git a/gitlab/utils.py b/gitlab/utils.py
index f549042..7b01d17 100644
--- a/gitlab/utils.py
+++ b/gitlab/utils.py
@@ -44,7 +44,11 @@ def response_content(
return None
-def copy_dict(dest: Dict[str, Any], src: Dict[str, Any]) -> None:
+def copy_dict(
+ *,
+ src: Dict[str, Any],
+ dest: Dict[str, Any],
+) -> None:
for k, v in src.items():
if isinstance(v, dict):
# Transform dict values to new attributes. For example: