feat(annotations): support create() with term/value labels#684
feat(annotations): support create() with term/value labels#684JWCook merged 5 commits intopyinat:mainfrom
Conversation
|
Pushed a small follow-up in cdec97d to address patch coverage:
Local run on this branch now shows 100% coverage for |
|
Thanks for the review. I pushed follow-up commit 6d7acef with the requested changes:
Validation run on this branch:
If this looks good, please re-review when you have a moment. |
|
All review threads from the previous round are now addressed and marked resolved, and CI is green on the latest commit.\n\nWhen you have a chance, could you take a final re-review pass? |
| resource_id: IntOrStr, | ||
| controlled_attribute_id: int | None = None, | ||
| controlled_value_id: int | None = None, | ||
| resource_id: IntOrStr | None = None, |
There was a problem hiding this comment.
Just one more thing I noticed: resource_id is always going to be required, so let's make that a required positional parameter.
Other than that, I think this looks good!
|
Good catch, thanks. I pushed follow-up commit 542bc3c to make resource_id a required positional parameter in annotations.create(). What changed:
Validation:
|
|
Looks good. Thank you! |
Summary
AnnotationController.create()Details
create()now accepts either:controlled_attribute_id+controlled_value_id(existing path), orterm+value(new path)strip()+ case-insensitive match)GET /controlled_termsTests
Added/updated controller tests:
test_create__by_labeltest_create__missing_term_value_pairtest_create__invalid_termtest_create__invalid_value_for_termValidation
uv tool run ruff check pyinaturalist/controllers/annotation_controller.py test/controllers/test_annotation_controller.pyuv run pytest -q test/controllers/test_annotation_controller.pyCloses #528