From edf2cdb70b8765cd7bf5214f29668159d24646dc Mon Sep 17 00:00:00 2001 From: soymd Date: Tue, 17 Mar 2026 11:15:01 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20get=5Fproject=5Fcomments=20?= =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(#10863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - プロジェクト単位でコメント一覧を取得するSDKメソッドを追加 - フィルタパラメータ: status, external_status, tags, issue_category_id --- fastlabel/__init__.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 1d702ed..32409f0 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -5257,6 +5257,36 @@ def get_task_comments( params["limit"] = limit return self.api.get_request(endpoint, params=params) + def get_project_comments( + self, + project: str, + status: str = None, + external_status: str = None, + tags: list = None, + issue_category_id: str = None, + offset: int = None, + limit: int = 100, + ) -> list: + if limit > 1000: + raise FastLabelInvalidException( + "Limit must be less than or equal to 1000.", 422 + ) + endpoint = "comments" + params = {"project": project} + if status: + params["status"] = status + if external_status: + params["externalStatus"] = external_status + if tags: + params["tags"] = tags + if issue_category_id: + params["issueCategoryId"] = issue_category_id + if offset: + params["offset"] = offset + if limit: + params["limit"] = limit + return self.api.get_request(endpoint, params=params) + def mask_to_fastlabel_segmentation_points( self, mask_image: Union[str, np.ndarray] ) -> List[List[List[int]]]: From 9355e51a670fc86a3f49337a1e210e62fcae25b7 Mon Sep 17 00:00:00 2001 From: soymd Date: Tue, 17 Mar 2026 14:19:18 +0900 Subject: [PATCH 2/6] =?UTF-8?q?docs:=20get=5Fproject=5Fcomments=20?= =?UTF-8?q?=E3=81=AEREADME=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=A8=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 52 ++++++++++++++++++++++++++++++++ examples/get_project_comments.py | 8 +++++ 2 files changed, 60 insertions(+) create mode 100644 examples/get_project_comments.py diff --git a/README.md b/README.md index 7e33841..237342b 100644 --- a/README.md +++ b/README.md @@ -2719,6 +2719,58 @@ Example of a comment object } ``` +### Get Project Comments + +Get comments of a project. Returns up to 1000 comments per request. Use `offset` for pagination. + +```python +comments = client.get_project_comments(project="YOUR_PROJECT_SLUG") +``` + +#### Parameters + +| Name | Type | Required | Description | +|------|------|----------|-------------| +| project | str | Yes | Project slug | +| status | str | No | Filter by status | +| external_status | str | No | Filter by external status | +| tags | list | No | Filter by tags | +| issue_category_id | str | No | Filter by issue category ID | +| offset | int | No | Offset for pagination | +| limit | int | No | Number of comments to retrieve (default: 100, max: 1000) | + +### Response + +Example of a comment object + +```python +{ + "id": "YOUR_COMMENT_ID", + "taskId": "YOUR_TASK_ID", + "contentId": "YOUR_CONTENT_ID", + "type": "text", + "isResolved": False, + "points": [185.98, 86.55], + "scale": 0, + "frame": 0, + "status": "todo", + "priority": 0, + "taskAnnotationId": None, + "issueCategoryId": None, + "color": None, + "threads": [ + { + "id": "YOUR_THREAD_ID", + "text": "comment text", + "createdAt": "2026-03-03T03:51:55.247Z", + "updatedAt": "2026-03-03T03:51:55.247Z", + }, + ], + "createdAt": "2026-03-03T03:51:55.240Z", + "updatedAt": "2026-03-03T03:51:55.240Z", +} +``` + ## Project ### Create Project diff --git a/examples/get_project_comments.py b/examples/get_project_comments.py new file mode 100644 index 0000000..b37ff49 --- /dev/null +++ b/examples/get_project_comments.py @@ -0,0 +1,8 @@ +from pprint import pprint + +import fastlabel + +client = fastlabel.Client() + +comments = client.get_project_comments(project="YOUR_PROJECT_SLUG") +pprint(comments) From 62b55cedad302d2b051afbfefceb177d1bb4a682 Mon Sep 17 00:00:00 2001 From: soymd Date: Tue, 17 Mar 2026 14:35:35 +0900 Subject: [PATCH 3/6] =?UTF-8?q?get=5Fproject=5Fcomments=20API=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=90=8D=E3=82=92=E3=82=A2?= =?UTF-8?q?=E3=83=97=E3=83=AA=E5=81=B4=E5=A4=89=E6=9B=B4=E3=81=AB=E5=90=88?= =?UTF-8?q?=E3=82=8F=E3=81=9B=E3=81=A6=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tags/status/externalStatus → taskTags/taskStatus/taskExternalStatus fastlabel/fastlabel-application#10927 --- fastlabel/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 32409f0..1081bb2 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -5274,11 +5274,11 @@ def get_project_comments( endpoint = "comments" params = {"project": project} if status: - params["status"] = status + params["taskStatus"] = status if external_status: - params["externalStatus"] = external_status + params["taskExternalStatus"] = external_status if tags: - params["tags"] = tags + params["taskTags"] = tags if issue_category_id: params["issueCategoryId"] = issue_category_id if offset: From c186e1aaddfb41497336ea1336e30b8ef5962548 Mon Sep 17 00:00:00 2001 From: soymd Date: Wed, 18 Mar 2026 09:47:06 +0900 Subject: [PATCH 4/6] =?UTF-8?q?get=5Fproject=5Fcomments:=20=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?GET=20/v1/comments/threads=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97?= =?UTF-8?q?=E3=83=AC=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B9=E5=9E=8B=E3=82=92?= =?UTF-8?q?CommentThreadExportVO=E3=81=AB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 58 +++++++++++++++----------------- examples/get_project_comments.py | 4 +-- fastlabel/__init__.py | 6 ++-- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 237342b..bb127f2 100644 --- a/README.md +++ b/README.md @@ -2721,10 +2721,10 @@ Example of a comment object ### Get Project Comments -Get comments of a project. Returns up to 1000 comments per request. Use `offset` for pagination. +Get comment threads of a project. Returns up to 1000 comment threads per request. Use `offset` for pagination. ```python -comments = client.get_project_comments(project="YOUR_PROJECT_SLUG") +comment_threads = client.get_project_comments(project="YOUR_PROJECT_SLUG") ``` #### Parameters @@ -2732,42 +2732,40 @@ comments = client.get_project_comments(project="YOUR_PROJECT_SLUG") | Name | Type | Required | Description | |------|------|----------|-------------| | project | str | Yes | Project slug | -| status | str | No | Filter by status | -| external_status | str | No | Filter by external status | -| tags | list | No | Filter by tags | +| status | str | No | Filter by task status | +| external_status | str | No | Filter by task external status | +| tags | list | No | Filter by task tags | | issue_category_id | str | No | Filter by issue category ID | | offset | int | No | Offset for pagination | -| limit | int | No | Number of comments to retrieve (default: 100, max: 1000) | +| limit | int | No | Number of comment threads to retrieve (default: 100, max: 1000) | ### Response -Example of a comment object +Example of a comment thread object ```python { - "id": "YOUR_COMMENT_ID", - "taskId": "YOUR_TASK_ID", - "contentId": "YOUR_CONTENT_ID", - "type": "text", - "isResolved": False, - "points": [185.98, 86.55], - "scale": 0, - "frame": 0, - "status": "todo", - "priority": 0, - "taskAnnotationId": None, - "issueCategoryId": None, - "color": None, - "threads": [ - { - "id": "YOUR_THREAD_ID", - "text": "comment text", - "createdAt": "2026-03-03T03:51:55.247Z", - "updatedAt": "2026-03-03T03:51:55.247Z", - }, - ], - "createdAt": "2026-03-03T03:51:55.240Z", - "updatedAt": "2026-03-03T03:51:55.240Z", + "id": "YOUR_THREAD_ID", + "text": "comment text", + "comment": { + "id": "YOUR_COMMENT_ID", + "taskId": "YOUR_TASK_ID", + "contentId": "YOUR_CONTENT_ID", + "type": "text", + "isResolved": False, + "points": [185.98, 86.55], + "scale": 0, + "frame": 0, + "status": "todo", + "priority": 0, + "taskAnnotationId": None, + "issueCategoryId": None, + "color": None, + "createdAt": "2026-03-03T03:51:55.240Z", + "updatedAt": "2026-03-03T03:51:55.240Z", + }, + "createdAt": "2026-03-03T03:51:55.247Z", + "updatedAt": "2026-03-03T03:51:55.247Z", } ``` diff --git a/examples/get_project_comments.py b/examples/get_project_comments.py index b37ff49..f03a61e 100644 --- a/examples/get_project_comments.py +++ b/examples/get_project_comments.py @@ -4,5 +4,5 @@ client = fastlabel.Client() -comments = client.get_project_comments(project="YOUR_PROJECT_SLUG") -pprint(comments) +comment_threads = client.get_project_comments(project="YOUR_PROJECT_SLUG") +pprint(comment_threads) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 1081bb2..7ab5537 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -5248,9 +5248,7 @@ def get_task_comments( "Limit must be less than or equal to 1000.", 422 ) endpoint = "comments" - params = {"project": project} - if task_id: - params["taskId"] = task_id + params = {"project": project, "taskId": task_id} if offset: params["offset"] = offset if limit: @@ -5271,7 +5269,7 @@ def get_project_comments( raise FastLabelInvalidException( "Limit must be less than or equal to 1000.", 422 ) - endpoint = "comments" + endpoint = "comments/threads" params = {"project": project} if status: params["taskStatus"] = status From b32588731692195992993b49335206bf224b75d5 Mon Sep 17 00:00:00 2001 From: soymd Date: Wed, 18 Mar 2026 12:04:40 +0900 Subject: [PATCH 5/6] =?UTF-8?q?README=E3=81=AE=E8=A6=8B=E5=87=BA=E3=81=97?= =?UTF-8?q?=E3=83=AC=E3=83=99=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3=EF=BC=88?= =?UTF-8?q?"###=20Response"=20=E2=86=92=20"####=20Response"=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb127f2..f3d870a 100644 --- a/README.md +++ b/README.md @@ -2739,7 +2739,7 @@ comment_threads = client.get_project_comments(project="YOUR_PROJECT_SLUG") | offset | int | No | Offset for pagination | | limit | int | No | Number of comment threads to retrieve (default: 100, max: 1000) | -### Response +#### Response Example of a comment thread object From a7c0e5f279cbc1f74c7b2bb5e14d9975cfbf15a1 Mon Sep 17 00:00:00 2001 From: soymd Date: Wed, 18 Mar 2026 12:11:30 +0900 Subject: [PATCH 6/6] =?UTF-8?q?get=5Ftask=5Fcomments/get=5Fproject=5Fcomme?= =?UTF-8?q?nts=20offset=E3=83=BBlimit=E3=81=AE=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=20is=20not=20None=20=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRレビュー指摘対応: if offset: / if limit: だと値が0のときFalsyとして無視されるため、 is not None チェックに変更した --- fastlabel/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 7ab5537..5b79c1f 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -5249,9 +5249,9 @@ def get_task_comments( ) endpoint = "comments" params = {"project": project, "taskId": task_id} - if offset: + if offset is not None: params["offset"] = offset - if limit: + if limit is not None: params["limit"] = limit return self.api.get_request(endpoint, params=params) @@ -5279,9 +5279,9 @@ def get_project_comments( params["taskTags"] = tags if issue_category_id: params["issueCategoryId"] = issue_category_id - if offset: + if offset is not None: params["offset"] = offset - if limit: + if limit is not None: params["limit"] = limit return self.api.get_request(endpoint, params=params)