-
Notifications
You must be signed in to change notification settings - Fork 16
Custom Metadata tool #163
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
base: main
Are you sure you want to change the base?
Custom Metadata tool #163
Conversation
…nd merge generic ones into search_assets_tool
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def process_business_metadata( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep it consistent to custom_metadata
| Returns: | ||
| Dictionary containing prompt, metadata details, and id | ||
| """ | ||
| cm_name = cm_def.name or "N/A" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the default values correct?
| attributes_list_for_prompt: List[str] = [] | ||
| parsed_attributes_for_metadata: List[Dict[str, Any]] = [] | ||
|
|
||
| if cm_def.attribute_defs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do if not raise
| if cm_def.attribute_defs: | ||
| for attr_def in cm_def.attribute_defs: | ||
| attr_name = attr_def.display_name or attr_def.name or "Unnamed attribute" | ||
| attr_desc = attr_def.description or "No description" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check default values here as well
| attributes_list_for_prompt.append(f"{attr_name}:{attr_desc}") | ||
|
|
||
| base_description = attr_def.description or "" | ||
| enhanced_description = base_description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this supposed to do?
| ) | ||
|
|
||
| # Process explicit custom metadata negative conditions | ||
| if custom_metadata_negative_conditions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are negative conditions separately processed? Isn't it just a operator difference?
| Returns: | ||
| Dict[str, Any]: Dictionary containing: | ||
| - context: Description of the returned data | ||
| - business_metadata_results: List of business metadata definitions, each containing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this consistent
| - description: Description of the custom metadata set | ||
| - attributes: List of attribute definitions with name, display_name, data_type, | ||
| description, and optional enumEnrichment (with allowed values) | ||
| - id: GUID of the custom metadata definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to send this?
| ), | ||
| "gte": lambda custom_metadata_field_class, | ||
| value: custom_metadata_field_class.gte(value), | ||
| "match": lambda custom_metadata_field_class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how will the LLM know all the allowed values?
| assets = search_assets( | ||
| conditions={ | ||
| "custom_metadata": { | ||
| "Data Quality.quality_score": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the LLM use the names rather than displayNames for this?
Changes from Original MCP-8 Implementation
Removed separate
custom_metadata_conditionsparameter - Custom metadata filters are now part of the mainconditionsparameter under a nestedcustom_metadatakey for consistency with standard attributes.Simplified the nested structure - Changed from 4-level nested
custom_metadata_filter+property_filtersformat to simple dot notation:"SetName.AttributeName": value.Removed custom API code - Deleted 69 lines of manual HTTP request handling in
settings.py(includingbuild_api_url(),get_atlan_typedef_api_endpoint(), andmake_request()methods).Switched to PyAtlan native classes - Now uses
CustomMetadataCacheandEnumCachefrom PyAtlan instead of making direct API calls to fetch typedefs.Unified processing logic - Removed the separate
_process_custom_metadata_condition()function (~90 lines). Custom metadata now uses the same_process_condition()function as standard attributes.