set_display_annotation
Set display annotations on tables or columns to control naming, tooltips, and null-value display. Stage changes locally and apply them with apply_annotations().
Instructions
Set the display annotation on a table or column.
The display annotation controls basic naming and display options. Changes are staged locally until apply_annotations() is called.
Args: table_name: Name of the table. column_name: Name of the column (optional). If provided, sets the annotation on the column; otherwise sets it on the table. annotation: The display annotation value. Set to null/None to remove.
Display Annotation Schema (tag:isrd.isi.edu,2015:display):
{
"name": "string", // Display name (mutually exclusive with markdown_name)
"markdown_name": "string", // Markdown-formatted name (mutually exclusive with name)
"name_style": {
"underline_space": true, // Replace underscores with spaces
"title_case": true, // Apply title case
"markdown": true // Interpret as markdown
},
"comment": "string", // Tooltip/description text
"show_null": { // How to display null values per context
"*": true, // true = show "No value", false = hide, "string" = custom
"compact": false,
"detailed": ""N/A""
},
"show_foreign_key_link": { // Show FK as link per context
"*": true,
"compact": false
}
}Valid contexts for show_null/show_foreign_key_link:
"*" (all contexts)
"compact", "compact/select", "compact/brief", "compact/brief/inline"
"detailed"
Returns: JSON with status and the target (table or column).
Examples: # Set table display name set_display_annotation("Image", annotation={"name": "Images"})
# Set column display name
set_display_annotation("Image", "Filename", {"name": "File Name"})
# Set name style to replace underscores with spaces
set_display_annotation("Image", annotation={"name_style": {"underline_space": true}})
# Remove display annotation
set_display_annotation("Image", annotation=null)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| annotation | No | ||
| table_name | Yes | ||
| column_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |