You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "msyavuz (via GitHub)" <gi...@apache.org> on 2025/02/05 11:45:23 UTC

[PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

msyavuz opened a new pull request, #32142:
URL: https://github.com/apache/superset/pull/32142

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   Add examples to filter_state and permalink endpoints and add parameters to embedded endpoint.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   After:
   ![image](https://github.com/user-attachments/assets/cb2fb25b-653d-4496-bcdc-5b8bd90267c8)
   ![image](https://github.com/user-attachments/assets/ab05e5c6-f1e7-4c24-ac70-72adbb32940c)
   ![image](https://github.com/user-attachments/assets/c34d15f2-6e7a-49dc-a363-088a096742dd)
   
   > [!NOTE]
   > Endpoint for filter_state accepts the body in the form of { "value": "stringified json" }. I documented the endpoint with actual json object and specified that it should be stringified and put into value field of the body in the examples. Other approach would be to just put the stringified example there which makes it unreadable but is more reflective.
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   Go to local instance of swagger ui at /swagger/v1 and check for the documentation.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Fixes #32046
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido commented on code in PR #32142:
URL: https://github.com/apache/superset/pull/32142#discussion_r1943504143


##########
superset/embedded_dashboard/__init__.py:
##########
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   Any reasons for deleting this? Can you bring it back? 



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on PR #32142:
URL: https://github.com/apache/superset/pull/32142#issuecomment-2637701528

   Thanks for the great docs @msyavuz! Can we remove the `embedded_dashboard` folder given that it's empty?
   
   Tagging some folks that might know if that folder is needed. @Vitor-Avila @betodealmeida


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on PR #32142:
URL: https://github.com/apache/superset/pull/32142#issuecomment-2637744352

   No problem! As far as i know git doesn't deal with directories so it should be out of index already since its empty? Just need to run `git clean -fd` locally


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido commented on code in PR #32142:
URL: https://github.com/apache/superset/pull/32142#discussion_r1943504827


##########
superset/embedded_dashboard/__init__.py:
##########
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   I think this might be used by some organizations so we don't want to delete it if it is not necessary



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #32142:
URL: https://github.com/apache/superset/pull/32142#discussion_r1943547915


##########
superset/embedded_dashboard/__init__.py:
##########
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one

Review Comment:
   If this folder is used, it would be good to add some comment or README file. Empty folders can be deleted at any time during cleanup efforts.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #32142:
URL: https://github.com/apache/superset/pull/32142#issuecomment-2636524648

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/32142?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 65.50%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`fc64682`)](https://app.codecov.io/gh/apache/superset/commit/fc64682d99e24bb01e908ff199c4c5769bb5e1b4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 1404 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #32142      +/-   ##
   ==========================================
   + Coverage   60.48%   65.50%   +5.02%     
   ==========================================
     Files        1931      545    -1386     
     Lines       76236    39042   -37194     
     Branches     8568        0    -8568     
   ==========================================
   - Hits        46114    25576   -20538     
   + Misses      28017    13466   -14551     
   + Partials     2105        0    -2105     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.49% <100.00%> (-0.67%)` | :arrow_down: |
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.03% <100.00%> (-0.77%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.50% <100.00%> (+2.02%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/32142/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `61.01% <100.00%> (+3.38%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/32142?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(api): Improve api documentation for dashboard endpoints(filter_state, permalink, embedded) [superset]

Posted by "geido (via GitHub)" <gi...@apache.org>.
geido merged PR #32142:
URL: https://github.com/apache/superset/pull/32142


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org