Update project tags type to what is expected/returned by API #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the type hints of the
tags
property of theProject
class to align with what is expected and returned by the Doccano API. This addresses issues around creating, updating, and retrieving Doccano projects that have tags associated. Now that the issue mentioned in #149 is addressed I've found that theDoccanoClient.update_project()
method fails to actually update tags when that kwarg is passed. Will open a separate issue for this since you can't actually reproduce the failed update of tags unless this PRs change is part of your localdoccano-client
Fixes #149 (Unable to retrieve projects with tags)
Reproduction of issue before fix:
find_project_by_id()
:list_projects()
:create_project()
w/ tags as specified in docs:create_project()
w/ tags asList[Dict[str, str]]
:update_project()
w/ tags as specified in docs:update_project()
w/ tags asList[Dict[str, str]]
:Demonstration of successful fix using client created from this branch:
find_project_by_id()
:list_projects()
(truncated but demonstrates no failure):create_project()
:update_project()
here you'll notice tags aren't actually updated but we can tell the call succeeded as the description was updated, this seems to be a separate bug only reproducible once this PRs fix is in place:NOTE: This work was done as part of my employment at GoGuardian, Inc.