Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: require kwargs forutils.copy_dict()#1871

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/copy_dict
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionsgitlab/client.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -647,7 +647,7 @@ def http_request(
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
Expand All@@ -656,12 +656,12 @@ def http_request(
# 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()

Expand Down
6 changes: 5 additions & 1 deletiongitlab/utils.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp