dosubot[bot] commented on issue #36966:
URL: https://github.com/apache/superset/issues/36966#issuecomment-3721883894

   <!-- Answer -->
   There’s no official documentation or enforced schema for the annotation JSON 
metadata field in Superset. It’s an optional, free-form JSON string—any valid 
JSON is accepted, but Superset doesn’t interpret or act on specific keys in 
this field as of 6.0.0. The UI just provides a JSON editor, and the backend 
only validates that the input is valid JSON 
([source](https://github.com/apache/superset/blob/master/superset/annotation_layers/annotations/schemas.py),
 
[source](https://github.com/apache/superset/blob/master/superset-frontend/src/features/annotations/AnnotationModal.tsx)).
   
   You can use this field to store custom descriptive info or metadata for your 
own reference. For example:
   
   ```json
   {
     "note": "Reference line for Q1 target",
     "created_by": "analyst_team",
     "color": "#FF0000"
   }
   ```
   
   Keys like `granularity`, `time_grain_sqla`, `time_range`, and `time_shift` 
are mentioned in the codebase as possible overrides, but these are not 
functional in Superset 6.0.0 
([source](https://github.com/apache/superset/blob/master/superset/charts/schemas.py)).
 So, for now, stick to using the JSON metadata field for static, descriptive, 
or custom info only.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/fe3d17f8-6de9-4857-894a-1b41436190ae?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=There%E2%80%99s%20no%20official%20documentation%20or%20enforced%20schema%20for%20the%20annotation%20JSON%20metadata%20field%20in%20Superset.%20It%E2%80%99s%20an%20optional%2C%20free-form%20JSON%20string%E2%80%94any%20valid%20JSON%20is%20accepted%2C%20but%20Superset%20doesn%E2%80%99t%20interpret%20or%20act%20on%20specific%20keys%20in%20this%20field%20as%20of%206.0.0.%20The%20UI%20just%20provides%20a%20JSON%20editor%2C%20and%20the%20backend%20only%20validates%20that%20the%20input%20is%20valid%20JSON%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/blob/master/superset/annotation_layers/annotations/schemas.py%29%2C%C2%A0%5Bsource%5D%28https%3A//github.com/apache/superset/blob/master/superset-frontend/src/features/annotations/AnnotationModal
 
.tsx%29%29.%0A%0AYou%20can%20use%20this%20field%20to%20store%20custom%20descriptive%20info%20or%20metadata%20for%20your%20own%20reference.%20For%20example%3A%0A%0A%60%60%60json%0A%7B%0A%20%20%22note%22%3A%20%22Reference%20line%20for%20Q1%20target%22%2C%0A%20%20%22created_by%22%3A%20%22analyst_team%22%2C%0A%20%20%22color%22%3A%20%22%23FF0000%22%0A%7D%0A%60%60%60%0A%0AKeys%20like%20%60granularity%60%2C%20%60time_grain_sqla%60%2C%20%60time_range%60%2C%20and%20%60time_shift%60%20are%20mentioned%20in%20the%20codebase%20as%20possible%20overrides%2C%20but%20these%20are%20not%20functional%20in%20Superset%206.0.0%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/blob/master/superset/charts/schemas.py%29%29.%20So%2C%20for%20now%2C%20stick%20to%20using%20the%20JSON%20metadata%20field%20for%20static%2C%20descriptive%2C%20or%20custom%20info%20only.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp
 ;[![Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36966)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to