Skip to content

Commit 2ace671

Browse files
committed
fix #102
1 parent c3ce6aa commit 2ace671

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

annofabapi/wrapper.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import annofabapi.utils
1313
from annofabapi import AnnofabApi
1414
from annofabapi.exceptions import AnnofabApiException
15-
from annofabapi.models import (AnnotationSpecs, InputData, Inspection, InspectionStatus, Instruction, JobInfo, JobType,
15+
from annofabapi.models import (AnnotationSpecsV1, InputData, Inspection, InspectionStatus, Instruction, JobInfo, JobType,
1616
MyOrganization, Organization, OrganizationMember, Project, ProjectMember,
1717
SupplementaryData, Task)
1818
from annofabapi.utils import allow_404_error
@@ -170,10 +170,12 @@ def get_all_annotation_list(self, project_id: str,
170170
# Public Method : AnnotationSpecs
171171
#########################################
172172
def copy_annotation_specs(self, src_project_id: str, dest_project_id: str,
173-
comment: Optional[str] = None) -> AnnotationSpecs:
173+
comment: Optional[str] = None) -> AnnotationSpecsV1:
174174
"""
175175
アノテーション仕様を、別のプロジェクトにコピーする。
176176
177+
.. deprecated:: XXXXX
178+
177179
Note:
178180
誤って実行しないようにすること
179181
@@ -185,6 +187,7 @@ def copy_annotation_specs(self, src_project_id: str, dest_project_id: str,
185187
Returns:
186188
put_annotation_specsのContent
187189
"""
190+
warnings.warn("deprecated", DeprecationWarning)
188191
src_annotation_specs = self.api.get_annotation_specs(src_project_id)[0]
189192

190193
if comment is None:
@@ -717,15 +720,13 @@ def to_inactive(arg_member):
717720
#########################################
718721
# Public Method : Task
719722
#########################################
720-
def initiate_tasks_generation_by_csv(self, project_id: str, csvfile_path: str,
721-
task_id_prefix: str) -> Dict[str, Any]:
723+
def initiate_tasks_generation_by_csv(self, project_id: str, csvfile_path: str) -> Dict[str, Any]:
722724
"""
723-
CSV Fileでタスクを生成する
725+
タスクID,入力データ名,入力データID」を1行毎に指定したCSVを使って、タスクを生成する
724726
725727
Args:
726728
project_id: プロジェクトID
727729
csvfile_path: CSVファイルのパス
728-
task_id_prefix: 生成するタスクIDのプレフィックス
729730
730731
Returns:
731732
`initiate_tasks_generation` APIのContent
@@ -739,7 +740,6 @@ def initiate_tasks_generation_by_csv(self, project_id: str, csvfile_path: str,
739740
'_type': 'ByInputDataCsv',
740741
'csv_data_path': s3_path,
741742
},
742-
'task_id_prefix': task_id_prefix,
743743
'project_last_updated_datetime': project_last_updated_datetime
744744
}
745745
return self.api.initiate_tasks_generation(project_id, request_body=request_body)[0]

tests/test_api.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ def test_task():
352352
time.sleep(3) # sleepしないと失敗したため
353353
assert len(wrapper.get_all_tasks(project_id, query_params={'task_id': test_task_id})) == 1
354354

355-
print(f"start_task (annotation)")
356-
request_body = {"phase": "annotation"}
357-
assert type(api.start_task(project_id, request_body=request_body)[0]) == dict
355+
print(f"assign_tasks")
356+
request_body = {"task_ids":[test_task_id], "user_id": annofab_user_id, "_type": "Selection"}
357+
assert type(api.assign_tasks(project_id, request_body=request_body)[0]) == dict
358358

359359
print(f"operate_task")
360360
request_body1 = {

0 commit comments

Comments
 (0)