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/06/07 21:44:10 UTC

[GitHub] [superset] lyndsiWilliams opened a new pull request, #20299: feat(explore): Dataset Panel Options when Source = Query II

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

   <!---
   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 -->
   This adds a different dataset panel dropdown when a chart's datasource is a query.
   
   
   ### SCREENSHOTS / ANIMATED GIF
   <!--- Skip this if not applicable -->
   <img width="695" alt="queryDatasourcePanel" src="https://user-images.githubusercontent.com/55605634/169922171-4ff59a63-8d69-4b44-8351-44611c76e967.png">
   <img width="1339" alt="queryDatasourceSaveDatasetModal" src="https://user-images.githubusercontent.com/55605634/169922178-cacf88c2-d6ac-4cfc-857a-b34465812f0e.png">
   
   ![queryDatasetPanel](https://user-images.githubusercontent.com/55605634/169922192-b754d665-d936-4967-9f08-617575e24695.gif)
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   - Open a chart with a query datasource type
   - Click the thee dots next to the chart name to reveal the dataset options dropdown
   - Observe that the options are now "Query preview", "View in SQL Lab", and "Save as dataset"
   - Click "View in SQL Lab" to be taken to SQL Lab
   - Click "Save as dataset" and observe the save dataset modal
   
   ### 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:
   - [x] 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] codecov[bot] commented on pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20299?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 [#20299](https://codecov.io/gh/apache/superset/pull/20299?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (236c489) into [master](https://codecov.io/gh/apache/superset/commit/ba0c37d3df85b1af39404af1d578daeb0ff2d278?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ba0c37d) will **increase** coverage by `0.00%`.
   > The diff coverage is `87.50%`.
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #20299   +/-   ##
   =======================================
     Coverage   66.61%   66.61%           
   =======================================
     Files        1733     1733           
     Lines       64953    64966   +13     
     Branches     6858     6858           
   =======================================
   + Hits        43268    43278   +10     
   - Misses      19929    19931    +2     
   - Partials     1756     1757    +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.52% <87.50%> (+<0.01%)` | :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/20299?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...re/components/controls/DatasourceControl/index.jsx](https://codecov.io/gh/apache/superset/pull/20299/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EYXRhc291cmNlQ29udHJvbC9pbmRleC5qc3g=) | `73.11% <85.71%> (+0.27%)` | :arrow_up: |
   | [...ges/superset-ui-core/src/query/types/Datasource.ts](https://codecov.io/gh/apache/superset/pull/20299/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-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvRGF0YXNvdXJjZS50cw==) | `100.00% <100.00%> (ø)` | |
   | [...d/src/explore/components/DatasourcePanel/index.tsx](https://codecov.io/gh/apache/superset/pull/20299/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvaW5kZXgudHN4) | `69.33% <100.00%> (-0.41%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20299?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/20299?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ba0c37d...236c489](https://codecov.io/gh/apache/superset/pull/20299?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -232,6 +262,20 @@ class DatasourceControl extends React.PureComponent {
       </Menu>
     );
 
+    const queryDatasourceMenu = (
+      <Menu onClick={this.handleMenuItemClick}>
+        <Menu.Item key={QUERY_PREVIEW}>{t('Query preview')}</Menu.Item>
+        <Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
+        <Menu.Item key={SAVE_AS_DATASET}>{t('Save as dataset')}</Menu.Item>
+      </Menu>
+    );
+
+    const datasourceTypeCheck =

Review Comment:
   nm, I see that you removed it in the other component. Still possibly a good way to make it more succinct. 



-- 
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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -264,7 +302,11 @@ class DatasourceControl extends React.PureComponent {
             <WarningIconWithTooltip warningMarkdown={extra.warning_markdown} />
           )}
           <AntdDropdown
-            overlay={datasourceMenu}
+            overlay={
+              isValidDatasourceType(datasource.type)
+                ? queryDatasourceMenu

Review Comment:
   is it just showing the query now for testing?



-- 
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] github-actions[bot] commented on pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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

   @lyndsiWilliams Ephemeral environment spinning up at http://34.209.46.24:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -232,6 +262,20 @@ class DatasourceControl extends React.PureComponent {
       </Menu>
     );
 
+    const queryDatasourceMenu = (
+      <Menu onClick={this.handleMenuItemClick}>
+        <Menu.Item key={QUERY_PREVIEW}>{t('Query preview')}</Menu.Item>
+        <Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
+        <Menu.Item key={SAVE_AS_DATASET}>{t('Save as dataset')}</Menu.Item>
+      </Menu>
+    );
+
+    const datasourceTypeCheck =

Review Comment:
   do we have this somewhere else? Also the current dataset is SlTable.. but I think I remember seeing us using Dataset? 



-- 
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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/DatasourcePanel/index.tsx:
##########
@@ -327,7 +321,7 @@ export default function DataSourcePanel({
           placeholder={t('Search Metrics & Columns')}
         />
         <div className="field-selections">
-          {isValidDatasourceType && showInfoboxCheck() && (
+          {isValidDatasourceType(datasource.type) && showInfoboxCheck() && (

Review Comment:
   is this supposed to show for only a certain type too?



-- 
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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -232,6 +262,20 @@ class DatasourceControl extends React.PureComponent {
       </Menu>
     );
 
+    const queryDatasourceMenu = (
+      <Menu onClick={this.handleMenuItemClick}>
+        <Menu.Item key={QUERY_PREVIEW}>{t('Query preview')}</Menu.Item>
+        <Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
+        <Menu.Item key={SAVE_AS_DATASET}>{t('Save as dataset')}</Menu.Item>
+      </Menu>
+    );
+
+    const datasourceTypeCheck =

Review Comment:
   Ok, since this still lives in two places, can we dry it up a bit with something like 
   `Object.values(DatasourceType).includes(datasource.type)`



-- 
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] lyndsiWilliams commented on pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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

   /testenv up


-- 
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] eschutho commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -232,6 +262,20 @@ class DatasourceControl extends React.PureComponent {
       </Menu>
     );
 
+    const queryDatasourceMenu = (
+      <Menu onClick={this.handleMenuItemClick}>
+        <Menu.Item key={QUERY_PREVIEW}>{t('Query preview')}</Menu.Item>
+        <Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
+        <Menu.Item key={SAVE_AS_DATASET}>{t('Save as dataset')}</Menu.Item>
+      </Menu>
+    );
+
+    const datasourceTypeCheck =

Review Comment:
   nm, I see that you removed it in the other component. Still possibly a good way to make it more succinct and potentially remove the import.



-- 
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] lyndsiWilliams commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -232,6 +262,20 @@ class DatasourceControl extends React.PureComponent {
       </Menu>
     );
 
+    const queryDatasourceMenu = (
+      <Menu onClick={this.handleMenuItemClick}>
+        <Menu.Item key={QUERY_PREVIEW}>{t('Query preview')}</Menu.Item>
+        <Menu.Item key={VIEW_IN_SQL_LAB}>{t('View in SQL Lab')}</Menu.Item>
+        <Menu.Item key={SAVE_AS_DATASET}>{t('Save as dataset')}</Menu.Item>
+      </Menu>
+    );
+
+    const datasourceTypeCheck =

Review Comment:
   Oh whoops, good catch! This already exists as `isValidDatasourceType` in `DatasourcePanel/index.tsx` here: https://github.com/apache/superset/blob/master/superset-frontend/src/explore/components/DatasourcePanel/index.tsx#L310-L314
   
   So I'll move/export/use that one instead.
   
   But it does include SlTable, as well as Dataset. I think it was set up that way to check for any of the DatasourceTypes (minus table and druid). Should I remove it?



-- 
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] lyndsiWilliams commented on a diff in pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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


##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -264,7 +302,11 @@ class DatasourceControl extends React.PureComponent {
             <WarningIconWithTooltip warningMarkdown={extra.warning_markdown} />
           )}
           <AntdDropdown
-            overlay={datasourceMenu}
+            overlay={
+              isValidDatasourceType(datasource.type)
+                ? queryDatasourceMenu

Review Comment:
   This only shows the query dropdown if the datasource is a query, it should not be showing at this point.



-- 
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] github-actions[bot] commented on pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

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

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] eschutho merged pull request #20299: feat(explore): Dataset Panel Options when Source = Query II

Posted by GitBox <gi...@apache.org>.
eschutho merged PR #20299:
URL: https://github.com/apache/superset/pull/20299


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