summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2023-03-04 18:23:25 -0800
committerNejc Habjan <hab.nejc@gmail.com>2023-03-12 11:11:49 +0100
commit90f96acf9e649de9874cec612fc1b49c4a843447 (patch)
tree4727076055cfdc9bdee96f9f0ea2a7e7865ac20f /gitlab/v4/objects
parentf2b5e4fa375e88d6102a8d023ae2fe8206042545 (diff)
downloadgitlab-90f96acf9e649de9874cec612fc1b49c4a843447.tar.gz
fix: support int for `parent_id` in `import_group`
This will also fix other use cases where an integer is passed in to MultipartEncoder. Added unit tests to show it works. Closes: #2506
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/groups.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 0eb516f..4dc4fd1 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -378,7 +378,7 @@ class GroupManager(CRUDMixin, RESTManager):
file: BinaryIO,
path: str,
name: str,
- parent_id: Optional[str] = None,
+ parent_id: Optional[Union[int, str]] = None,
**kwargs: Any,
) -> Union[Dict[str, Any], requests.Response]:
"""Import a group from an archive file.
@@ -399,7 +399,7 @@ class GroupManager(CRUDMixin, RESTManager):
A representation of the import status.
"""
files = {"file": ("file.tar.gz", file, "application/octet-stream")}
- data = {"path": path, "name": name}
+ data: Dict[str, Any] = {"path": path, "name": name}
if parent_id is not None:
data["parent_id"] = parent_id