korbit-ai[bot] commented on code in PR #32142:
URL: https://github.com/apache/superset/pull/32142#discussion_r1942725580


##########
superset/dashboards/filter_state/api.py:
##########
@@ -73,6 +73,76 @@ def post(self, pk: int) -> Response:
               application/json:
                 schema:
                   $ref: '#/components/schemas/TemporaryCachePostSchema'
+                examples:
+                  time_grain_filter:
+                    summary: "Time Grain Filter"
+                    description: "**This body should be stringified and put 
into the
+                    value field.**"
+                    value:
+                      id: NATIVE_FILTER_ID
+                      extraFormData:
+                        time_grain_sqla: "P1W/1970-01-03T00:00:00Z"
+                      filterState:
+                        label: "Week ending Saturday"
+                        value:
+                          - "P1W/1970-01-03T00:00:00Z"
+                  timecolumn_filter:
+                    summary: "Time Column Filter"
+                    description: "**This body should be stringified and put 
into the
+                    value field.**"
+                    value:
+                      id: NATIVE_FILTER_ID
+                      extraFormData:
+                        granularity_sqla: "order_date"
+                      filterState:
+                        value:
+                          - "order_date"
+                  time_range_filter:
+                    summary: "Time Range Filter"
+                    description: "**This body should be stringified and put 
into the
+                    value field.**"
+                    value:
+                      id: NATIVE_FILTER_ID
+                      extraFormData:
+                        time_range: 'DATEADD(DATETIME("2025-01-16T00:00:00"), 
-7, day) : 2025-01-16T00:00:00'
+                      filterState:
+                        value: 'DATEADD(DATETIME("2025-01-16T00:00:00"), -7, 
day) : 2025-01-16T00:00:00'
+                  numerical_range_filter:
+                    summary: "Numerical Range Filter"
+                    description: "**This body should be stringified and put 
into the
+                    value field.**"
+                    value:
+                      id: NATIVE_FILTER_ID
+                      extraFormData:
+                        filters:
+                          - col: "tz_offset"
+                            op: ">="
+                            val:
+                              - 1000
+                          - col: "tz_offset"
+                            op: "<="
+                            val:
+                              - 2000
+                      filterState:
+                        value:
+                          - 1000
+                          - 2000
+                        label: "1000 <= x <= 200"

Review Comment:
   ### Incorrect numerical range in filter example <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The numerical range filter example has an incorrect label that shows '200' 
instead of '2000', which does not match the actual filter values.
   
   ###### Why this matters
   This inconsistency between the label and the actual filter values (1000 to 
2000) could mislead API users and cause integration issues.
   
   ###### Suggested change ∙ *Feature Preview*
   Update the label to correctly reflect the filter range:
   ```python
   label: "1000 <= x <= 2000"
   ```
   
   
   </details>
   
   <sub>
   
   [![Report a problem with this 
comment](https://img.shields.io/badge/Report%20a%20problem%20with%20this%20comment-gray.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmNWVjMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10cmlhbmdsZS1hbGVydCI+PHBhdGggZD0ibTIxLjczIDE4LTgtMTRhMiAyIDAgMCAwLTMuNDggMGwtOCAxNEEyIDIgMCAwIDAgNCAyMWgxNmEyIDIgMCAwIDAgMS43My0zIi8+PHBhdGggZD0iTTEyIDl2NCIvPjxwYXRoIGQ9Ik0xMiAxN2guMDEiLz48L3N2Zz4=)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/5aa90d09-20e5-47a6-9fb4-4cbc9e8816d4?suggestedFixEnabled=true)
   
   💬 Chat with Korbit by mentioning @korbit-ai.
   </sub>
   
   <!--- korbi internal id:90751b27-b807-460e-b58d-e73b1cd6ba7e -->
   



##########
superset/embedded/api.py:
##########
@@ -71,13 +71,38 @@ def get(self, uuid: str) -> Response:
         """Get the dashboard's embedded configuration.
         ---
         get:
-          summary: Get the dashboard's embedded configuration
+          summary: Get the dashboard's embedded configuration this endpoint is 
also used to embed dashboards.

Review Comment:
   ### Unclear API Summary <sub>![category 
Documentation](https://img.shields.io/badge/Documentation-7c3aed)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The summary is unclear and contains redundant information. The phrase 'this 
endpoint is also used to embed dashboards' is confusing and doesn't add value.
   
   ###### Why this matters
   Unclear API documentation makes it harder for developers to understand the 
endpoint's primary purpose and can lead to misuse.
   
   ###### Suggested change ∙ *Feature Preview*
             summary: Get configuration and renders dashboard for embedding
   
   
   </details>
   
   <sub>
   
   [![Report a problem with this 
comment](https://img.shields.io/badge/Report%20a%20problem%20with%20this%20comment-gray.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmNWVjMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10cmlhbmdsZS1hbGVydCI+PHBhdGggZD0ibTIxLjczIDE4LTgtMTRhMiAyIDAgMCAwLTMuNDggMGwtOCAxNEEyIDIgMCAwIDAgNCAyMWgxNmEyIDIgMCAwIDAgMS43My0zIi8+PHBhdGggZD0iTTEyIDl2NCIvPjxwYXRoIGQ9Ik0xMiAxN2guMDEiLz48L3N2Zz4=)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2e6b46e7-6cf7-4640-874f-dc7c2aca326a?suggestedFixEnabled=true)
   
   💬 Chat with Korbit by mentioning @korbit-ai.
   </sub>
   
   <!--- korbi internal id:20c44058-d126-4cc5-8958-c1b5aca351c4 -->
   



-- 
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