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/27 00:22:44 UTC

[GitHub] [superset] hughhhh opened a new pull request, #20880: fix: Save dataset + chart when Chart source is Query

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

   <!---
   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 -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### 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] hughhhh commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -145,6 +166,44 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
       dashboard_title: string;
     };
 
+    if (this.props.datasource?.type === DatasourceType.Query) {

Review Comment:
   i'd rather use positive logic here, and un sure we'd want the same pattern for other datasource types as we continue integrate.



-- 
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] eric-briscoe commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

Posted by GitBox <gi...@apache.org>.
eric-briscoe commented on code in PR #20880:
URL: https://github.com/apache/superset/pull/20880#discussion_r931648936


##########
superset/views/core.py:
##########
@@ -2093,8 +2093,20 @@ def sqllab_viz(self) -> FlaskResponse:  # pylint: disable=no-self-use
             .filter_by(database_id=database_id, table_name=table_name)
             .one_or_none()
         )
-        if not table:
-            table = SqlaTable(table_name=table_name, owners=[g.user])
+
+        if table:
+            return json_errors_response(
+                [
+                    SupersetError(
+                        message=f"Dataset [{table_name}] already exist",

Review Comment:
   message=f"Dataset [{table_name}] already exist" <--- should this read 
   message=f"Dataset [{table_name}] already exists" <--- exists instead of exist



-- 
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 #20880: fix: Save dataset + chart when Chart source is Query

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20880?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 [#20880](https://codecov.io/gh/apache/superset/pull/20880?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8933542) into [master](https://codecov.io/gh/apache/superset/commit/3311128c5e6c5de2ea5d6a2dfeb01ea3179e9af8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3311128) will **decrease** coverage by `0.08%`.
   > The diff coverage is `12.50%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #20880      +/-   ##
   ==========================================
   - Coverage   66.29%   66.21%   -0.09%     
   ==========================================
     Files        1758     1758              
     Lines       66799    67041     +242     
     Branches     7055     7121      +66     
   ==========================================
   + Hits        44286    44388     +102     
   - Misses      20713    20834     +121     
   - Partials     1800     1819      +19     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.89% <12.50%> (-0.07%)` | :arrow_down: |
   
   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/20880?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/utils/localStorageHelpers.ts](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2xvY2FsU3RvcmFnZUhlbHBlcnMudHM=) | `90.00% <ø> (ø)` | |
   | [...rset-frontend/src/explore/components/SaveModal.tsx](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9TYXZlTW9kYWwudHN4) | `32.98% <8.33%> (-3.49%)` | :arrow_down: |
   | [.../explore/components/ExploreViewContainer/index.jsx](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci9pbmRleC5qc3g=) | `51.61% <25.00%> (-0.59%)` | :arrow_down: |
   | [...components/DashboardBuilder/DashboardContainer.tsx](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEJ1aWxkZXIvRGFzaGJvYXJkQ29udGFpbmVyLnRzeA==) | `40.00% <0.00%> (-32.23%)` | :arrow_down: |
   | [...nd/src/dashboard/util/activeAllDashboardFilters.ts](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2FjdGl2ZUFsbERhc2hib2FyZEZpbHRlcnMudHM=) | `60.00% <0.00%> (-26.96%)` | :arrow_down: |
   | [...set-frontend/src/explore/actions/hydrateExplore.ts](https://codecov.io/gh/apache/superset/pull/20880/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==) | `42.10% <0.00%> (-17.90%)` | :arrow_down: |
   | [...lugin-chart-handlebars/src/plugin/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtaGFuZGxlYmFycy9zcmMvcGx1Z2luL2NvbnRyb2xQYW5lbC50c3g=) | `50.00% <0.00%> (-16.67%)` | :arrow_down: |
   | [...tend/plugins/plugin-chart-handlebars/src/consts.ts](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtaGFuZGxlYmFycy9zcmMvY29uc3RzLnRz) | `66.66% <0.00%> (-8.34%)` | :arrow_down: |
   | [...ntrols/MetricControl/AdhocMetricPopoverTrigger.tsx](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9NZXRyaWNDb250cm9sL0FkaG9jTWV0cmljUG9wb3ZlclRyaWdnZXIudHN4) | `78.04% <0.00%> (-5.74%)` | :arrow_down: |
   | [...shboard/util/charts/getFormDataWithExtraFilters.ts](https://codecov.io/gh/apache/superset/pull/20880/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2NoYXJ0cy9nZXRGb3JtRGF0YVdpdGhFeHRyYUZpbHRlcnMudHM=) | `88.88% <0.00%> (-5.56%)` | :arrow_down: |
   | ... and [44 more](https://codecov.io/gh/apache/superset/pull/20880/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] hughhhh merged pull request #20880: fix: Save dataset + chart when Chart source is Query

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


-- 
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] AAfghahi commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -55,14 +59,22 @@ type SaveModalState = {
   saveToDashboardId: number | string | null;
   newSliceName?: string;
   newDashboardName?: string;
+  datasetName: string;
   alert: string | null;
   action: ActionType;
+  isLoading: boolean;
+  saveStatus: string | null;

Review Comment:
   If this can be null should it be optional?



-- 
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] AAfghahi commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset/models/sql_lab.py:
##########
@@ -57,7 +57,6 @@
 if TYPE_CHECKING:
     from superset.db_engine_specs import BaseEngineSpec
 
-

Review Comment:
   add this back in?



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -145,6 +166,44 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
       dashboard_title: string;
     };
 
+    if (this.props.datasource?.type === DatasourceType.Query) {

Review Comment:
   Will this conditional be true for saved queries as well? Is it worth to change this to !== Table?



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -71,8 +84,11 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
     this.state = {
       saveToDashboardId: null,
       newSliceName: props.sliceName,
+      datasetName: props.datasource?.name,

Review Comment:
   It looks like this is where you want to set the default '' value? I am confused why you had the empty string in the interface



##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -55,14 +60,22 @@ type SaveModalState = {
   saveToDashboardId: number | string | null;
   newSliceName?: string;
   newDashboardName?: string;
+  datasetName: '';

Review Comment:
   shouldn't this be string?



-- 
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 #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -55,14 +59,22 @@ type SaveModalState = {
   saveToDashboardId: number | string | null;
   newSliceName?: string;
   newDashboardName?: string;
+  datasetName: string;
   alert: string | null;
   action: ActionType;
+  isLoading: boolean;
+  saveStatus: string | null;
 };
 
 export const StyledModal = styled(Modal)`
   .ant-modal-body {
     overflow: visible;
   }
+  i {
+    position: absolute;
+    top: -21px;
+    left: 107px;

Review Comment:
   ```suggestion
       top: -${({ theme }) => theme.gridUnit * 5.25}px;
       left: ${({ theme }) => theme.gridUnit * 26.75}px;
   ```



-- 
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] hughhhh commented on a diff in pull request #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -71,8 +84,11 @@ class SaveModal extends React.Component<SaveModalProps, SaveModalState> {
     this.state = {
       saveToDashboardId: null,
       newSliceName: props.sliceName,
+      datasetName: props.datasource?.name,

Review Comment:
   yea i fixed that



-- 
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 #20880: fix: Save dataset + chart when Chart source is Query

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


##########
superset-frontend/src/explore/components/SaveModal.tsx:
##########
@@ -55,14 +59,22 @@ type SaveModalState = {
   saveToDashboardId: number | string | null;
   newSliceName?: string;
   newDashboardName?: string;
+  datasetName: string;
   alert: string | null;
   action: ActionType;
+  isLoading: boolean;
+  saveStatus: string | null;
 };
 
 export const StyledModal = styled(Modal)`
   .ant-modal-body {
     overflow: visible;
   }
+  i {
+    position: absolute;
+    top: -21px;
+    left: 107px;

Review Comment:
   ```suggestion
       top: -${({ theme }) => theme.gridUnit * 5.25}px;
       left: ${({ theme }) => theme.gridUnit * 26.75}px;
   ```
   Just a nit 😁 



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