You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/25 16:04:08 UTC

[GitHub] [superset] kgabryje opened a new pull request, #20850: feat: Reuse Dashboard redux data in Explore

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

   ### SUMMARY
   Reopen https://github.com/apache/superset/pull/20668
   
   Currently when user open Explore, we always send a request to `/v1/explore` endpoint, which assembles Explore initial data - slice, form_data and datasource.
   When user goes to Explore from Dashboard (by clicking "Edit chart" or chart title), most of the data needed to assemble Explore should already be available in Redux store.
   This PR implements using data from Dashboard Redux store to initialize Explore without calling `/v1/explore` endpoint.
   
   If user opens Explore from Dashboard, check if slice, formData, datasourceId and datasourceType are available. If they are, fetch datasource metadata and hydrate Explore using slice, formData and datasource.
   If they are not available, call `/v1/explore` and hydrate Explore.
   
   We can't reuse datasource from Dashboard. Datasources metadata on Dashboard is trimmed so that datasource contains only columns and metrics used by charts on that dashboard. In Explore we need to be able to access all columns and metrics, which means we must fetch those from API.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   1. Go to dashboard
   2. Click "Edit chart"
   3. Verify that Explore has opened correctly and that we did not call `/v1/explore/` endpoint
   4. Enter Explore from any other entry point (for example Charts list or Welcome page)
   5. Verify that we do call `/v1/explore`
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] 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


[GitHub] [superset] kgabryje closed pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
kgabryje closed pull request #20850: feat: Reuse Dashboard redux data in Explore
URL: https://github.com/apache/superset/pull/20850


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


[GitHub] [superset] codecov[bot] commented on pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20850:
URL: https://github.com/apache/superset/pull/20850#issuecomment-1194587666

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20850?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#20850](https://codecov.io/gh/apache/superset/pull/20850?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5c542ba) into [master](https://codecov.io/gh/apache/superset/commit/0945d4a2f46667aebb9b93d0d7685215627ad237?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0945d4a) will **decrease** coverage by `11.54%`.
   > The diff coverage is `33.33%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #20850       +/-   ##
   ===========================================
   - Coverage   66.17%   54.62%   -11.55%     
   ===========================================
     Files        1757     1757               
     Lines       66867    66866        -1     
     Branches     7077     7077               
   ===========================================
   - Hits        44246    36528     -7718     
   - Misses      20812    28529     +7717     
     Partials     1809     1809               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | postgres | `?` | |
   | presto | `53.13% <100.00%> (+0.02%)` | :arrow_up: |
   | python | `57.47% <100.00%> (-23.84%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `50.27% <100.00%> (+0.02%)` | :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=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/20850?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...d/packages/superset-ui-core/src/utils/isDefined.ts](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvdXRpbHMvaXNEZWZpbmVkLnRz) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/EditableTitle/index.tsx](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS9pbmRleC50c3g=) | `64.78% <ø> (ø)` | |
   | [superset-frontend/src/dashboard/actions/hydrate.js](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL2h5ZHJhdGUuanM=) | `1.96% <0.00%> (ø)` | |
   | [...end/src/dashboard/components/SliceHeader/index.tsx](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyL2luZGV4LnRzeA==) | `88.67% <ø> (ø)` | |
   | [...dashboard/components/SliceHeaderControls/index.tsx](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMvaW5kZXgudHN4) | `65.88% <ø> (ø)` | |
   | [.../src/dashboard/components/gridComponents/Chart.jsx](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0LmpzeA==) | `55.04% <ø> (ø)` | |
   | [superset-frontend/src/explore/ExplorePage.tsx](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvRXhwbG9yZVBhZ2UudHN4) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/explore/actions/hydrateExplore.ts](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9oeWRyYXRlRXhwbG9yZS50cw==) | `60.00% <ø> (ø)` | |
   | [superset/charts/schemas.py](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY2hhcnRzL3NjaGVtYXMucHk=) | `99.36% <100.00%> (+0.01%)` | :arrow_up: |
   | [superset/utils/dashboard\_import\_export.py](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGFzaGJvYXJkX2ltcG9ydF9leHBvcnQucHk=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [292 more](https://codecov.io/gh/apache/superset/pull/20850/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [superset] kgabryje commented on pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #20850:
URL: https://github.com/apache/superset/pull/20850#issuecomment-1194291596

   @jinghua-qa Could you please help with testing? This PR was previously [reverted](https://github.com/apache/superset/pull/20689) due to a bug that went unnoticed, I'm hoping to avoid repeating this mistake.


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


[GitHub] [superset] zhaoyongjie commented on a diff in pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on code in PR #20850:
URL: https://github.com/apache/superset/pull/20850#discussion_r929071798


##########
superset/charts/schemas.py:
##########
@@ -165,6 +170,11 @@ class ChartEntityResponseSchema(Schema):
     slice_url = fields.String(description=slice_url_description)
     certified_by = fields.String(description=certified_by_description)
     certification_details = fields.String(description=certification_details_description)
+    is_managed_externally = fields.Boolean(
+        description=is_managed_externally_description
+    )
+    owners = fields.List(fields.Nested(UserSchema))

Review Comment:
   a minor suggestion from recent fixing. the `owners` fields suggest that align with [Dashboard](https://github.com/apache/superset/pull/20826/files#) field to `owners = fields.List(fields.Dict())`.



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


[GitHub] [superset] kgabryje commented on pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #20850:
URL: https://github.com/apache/superset/pull/20850#issuecomment-1195077261

   I decided to close this PR - the performance gain from reusing the dashboard redux data was negligible at the cost of increased code complexity, which introduces a greater risk of bugs and regressions.


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


[GitHub] [superset] kgabryje commented on a diff in pull request #20850: feat: Reuse Dashboard redux data in Explore

Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #20850:
URL: https://github.com/apache/superset/pull/20850#discussion_r929104997


##########
superset/charts/schemas.py:
##########
@@ -165,6 +170,11 @@ class ChartEntityResponseSchema(Schema):
     slice_url = fields.String(description=slice_url_description)
     certified_by = fields.String(description=certified_by_description)
     certification_details = fields.String(description=certification_details_description)
+    is_managed_externally = fields.Boolean(
+        description=is_managed_externally_description
+    )
+    owners = fields.List(fields.Nested(UserSchema))

Review Comment:
   Hmm, I'm getting a 500 from the dashboard endpoint with that change
   <img width="1792" alt="image" src="https://user-images.githubusercontent.com/15073128/180833546-4e1524c9-f3fa-4705-8ab4-641a7c00e1d1.png">
   



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