Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project tags type to what is expected/returned by API #150

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions doccano_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def create_project(
allow_overlapping: bool = False,
grapheme_mode: bool = False,
use_relation: bool = False,
tags: Optional[List[str]] = None,
tags: Optional[List[Dict[str, str]]] = None,
dsciacca marked this conversation as resolved.
Show resolved Hide resolved
) -> Project:
"""Create a new project. `ProjectType` is one of the
`DocumentClassification`, `SequenceLabeling`, `Seq2seq`, `Speech2text`,
Expand All @@ -375,7 +375,7 @@ def create_project(
allow_overlapping (bool): If True, span overlapping is allowed. Defaults to False.
grapheme_mode (bool): If True, count multi-byte characters as one character. Defaults to False.
use_relation (bool): If True, relation labeling is allowed. Defaults to False.
tags (Optional[List[str]], optional): The tags of the project. Defaults to None.
tags (Optional[List[Dict[str, str]]], optional): The tags of the project. Defaults to None.

Returns:
Project: The created project.
Expand Down Expand Up @@ -407,7 +407,7 @@ def update_project(
allow_overlapping: bool = None,
grapheme_mode: bool = None,
use_relation: bool = None,
tags: Optional[List[str]] = None,
tags: Optional[List[Dict[str, str]]] = None,
) -> Project:
"""Update a project. `ProjectType` is one of the
`DocumentClassification`, `SequenceLabeling`, `Seq2seq`, `Speech2text`,
Expand All @@ -426,7 +426,7 @@ def update_project(
allow_overlapping (bool): If True, span overlapping is allowed. Defaults to None.
grapheme_mode (bool): If True, count multi-byte characters as one character. Defaults to None.
use_relation (bool): If True, relation labeling is allowed. Defaults to None.
tags (Optional[List[str]], optional): The tags of the project. Defaults to None.
tags (Optional[List[Dict[str, str]]], optional): The tags of the project. Defaults to None.

Returns:
Project: The updated project.
Expand Down
2 changes: 1 addition & 1 deletion doccano_client/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Project(BaseModel):
allow_overlapping: bool = False
grapheme_mode: bool = False
use_relation: bool = False
tags: List[str] = []
tags: List[DictStrAny] = []
dsciacca marked this conversation as resolved.
Show resolved Hide resolved

def dict(
self,
Expand Down
10 changes: 5 additions & 5 deletions doccano_client/usecase/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Iterator, List, Literal, Optional
from typing import Dict, Iterator, List, Literal, Optional

from doccano_client.models.project import Project
from doccano_client.repositories.project import ProjectRepository
Expand Down Expand Up @@ -51,7 +51,7 @@ def create(
allow_overlapping: bool = False,
grapheme_mode: bool = False,
use_relation: bool = False,
tags: Optional[List[str]] = None,
tags: Optional[List[Dict[str, str]]] = None,
) -> Project:
"""Create a new project

Expand All @@ -66,7 +66,7 @@ def create(
allow_overlapping (bool): If True, span overlapping is allowed. Defaults to False.
grapheme_mode (bool): If True, count multi-byte characters as one character. Defaults to False.
use_relation (bool): If True, relation labeling is allowed. Defaults to False.
tags (Optional[List[str]], optional): The tags of the project. Defaults to None.
tags (Optional[List[Dict[str, str]]], optional): The tags of the project. Defaults to None.

Returns:
Project: The created project
Expand Down Expand Up @@ -99,7 +99,7 @@ def update(
allow_overlapping: bool = None,
grapheme_mode: bool = None,
use_relation: bool = None,
tags: Optional[List[str]] = None,
tags: Optional[List[Dict[str, str]]] = None,
) -> Project:
"""Update a project

Expand All @@ -115,7 +115,7 @@ def update(
allow_overlapping (bool): If True, span overlapping is allowed. Defaults to None.
grapheme_mode (bool): If True, count multi-byte characters as one character. Defaults to None.
use_relation (bool): If True, relation labeling is allowed. Defaults to None.
tags (Optional[List[str]], optional): The tags of the project. Defaults to None.
tags (Optional[List[Dict[str, str]]], optional): The tags of the project. Defaults to None.

Returns:
Project: The updated project
Expand Down