feat(mcp): add list and get tools for annotation layers and annotations#17
Open
hbrooks wants to merge 6 commits into
Open
feat(mcp): add list and get tools for annotation layers and annotations#17hbrooks wants to merge 6 commits into
hbrooks wants to merge 6 commits into
Conversation
Co-Authored-By: kasiazjc <noreply@github.com>
- Use ModelGetInfoCore in get_annotation_layer_info (DRY, matches other get_info tools) - Expand search_columns to include descr and long_descr (align with docstrings) - Simplify layer_id assignment in list_layer_annotations (direct attribute set vs rebuild) - Fix AnnotationList.layer_id default to 0 (ModelListCore cannot inject domain fields) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AnnotationList.filters_applied used list[AnnotationFilter] which only allows col="short_descr", but ModelListCore injects a col="layer_id" ColumnOperator that fails Pydantic validation, causing KeyError on layer_id in the JSON response. Changed to list[ColumnOperator]. - test_get_annotation_layer_info_found: ModelGetInfoCore._find_object calls find_by_id(id, query_options=None), not find_by_id(id); updated assertion to assert_called_once_with(5, query_options=None).
Verify that returned annotations carry the expected layer_id, not just the response header. Fixes the case where a DAO filter failure would pass the old test undetected.
…tation tools Re-raise in list_layer_annotations exception handler to match the list_annotation_layers pattern and avoid swallowing middleware errors. Removes unused datetime/timezone imports. Strengthens the layer isolation test to explicitly verify layer_id=2 annotations are excluded.
…tation columns - Remove parentheses from @pytest.mark.asyncio and @pytest.fixture to match project style (PT023/PT001 compliance) - Add layer_id to DEFAULT_ANNOTATION_COLUMNS so it is always loaded from the database when listing annotations within a layer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Mirror of apache/superset#40342 by @aminghadersohi