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/04/19 19:45:24 UTC

[GitHub] [superset] codemaster08240328 opened a new pull request, #19782: fix: chart import error with virtual dataset

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

   <!---
   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 issue was not related to importing/exporting over api.
   
   This was happened through UI as well, and the reason was that we regards virtual dataset as sql lab view.
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   BEFORE:
   https://github.com/apache/superset/issues/13237
   
   AFTER:
   [[DEV] Superset - 19 April 2022 - Watch Video](https://www.loom.com/share/6b72207ac26840d8afd9a9b343e72af2)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   Check: https://github.com/apache/superset/issues/13237
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [X] Has associated issue: https://github.com/apache/superset/issues/13237
   - [ ] 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] betodealmeida commented on a diff in pull request #19782: fix: chart import error with virtual dataset

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


##########
superset/charts/commands/importers/v1/__init__.py:
##########
@@ -89,9 +89,7 @@ def _import(
                 config.update(
                     {
                         "datasource_id": dataset.id,
-                        "datasource_type": "view"
-                        if dataset.is_sqllab_view
-                        else "table",
+                        "datasource_type": "table",

Review Comment:
   I'm also not familiar with this part, so I created a chart from a virtual dataset and it has `datasource_type` set to `table`. Looking at the source code it seems that "view" here means a database `VIEW`, not a virtual dataset, and is only used by the DB engine spec to retrieve the list of views from a given database:
   
   https://github.com/apache/superset/blob/4a835a4299bbe90def232e376f919bc494b2d0a1/superset/db_engine_specs/base.py#L873-L879
   
   So I think this should be `table`, and we also need to fix this line:
   
   https://github.com/apache/superset/blob/4a835a4299bbe90def232e376f919bc494b2d0a1/superset/commands/importers/v1/examples.py#L141



-- 
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] codemaster08240328 commented on a diff in pull request #19782: fix: chart import error with virtual dataset

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


##########
superset/charts/commands/importers/v1/__init__.py:
##########
@@ -89,9 +89,7 @@ def _import(
                 config.update(
                     {
                         "datasource_id": dataset.id,
-                        "datasource_type": "view"
-                        if dataset.is_sqllab_view
-                        else "table",
+                        "datasource_type": "table",

Review Comment:
   but virtual dataset should have `view` as a 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] codecov[bot] commented on pull request #19782: fix: chart import error with virtual dataset

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19782?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 [#19782](https://codecov.io/gh/apache/superset/pull/19782?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eaf1539) into [master](https://codecov.io/gh/apache/superset/commit/b7759e6fd138aff83cc80eea23069268ecc717d9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b7759e6) will **decrease** coverage by `12.81%`.
   > The diff coverage is `65.88%`.
   
   > :exclamation: Current head eaf1539 differs from pull request most recent head 262f8bc. Consider uploading reports for the commit 262f8bc to get more accurate results
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #19782       +/-   ##
   ===========================================
   - Coverage   66.48%   53.67%   -12.82%     
   ===========================================
     Files        1686     1690        +4     
     Lines       64588    64616       +28     
     Branches     6636     6656       +20     
   ===========================================
   - Hits        42942    34682     -8260     
   - Misses      19947    28233     +8286     
   - Partials     1699     1701        +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | presto | `52.54% <25.00%> (+<0.01%)` | :arrow_up: |
   | python | `56.25% <25.00%> (-26.14%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `47.75% <25.00%> (-0.01%)` | :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/19782?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/src/SqlLab/components/TabbedSqlEditors/index.jsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMvaW5kZXguanN4) | `56.11% <0.00%> (-1.42%)` | :arrow_down: |
   | [superset-frontend/src/components/Chart/Chart.jsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvQ2hhcnQuanN4) | `52.54% <0.00%> (+2.54%)` | :arrow_up: |
   | [superset-frontend/src/components/Select/Select.tsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L1NlbGVjdC50c3g=) | `87.28% <ø> (ø)` | |
   | [...et-frontend/src/components/TableSelector/index.tsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGVTZWxlY3Rvci9pbmRleC50c3g=) | `75.55% <ø> (ø)` | |
   | [...dashboard/components/SliceHeaderControls/index.tsx](https://codecov.io/gh/apache/superset/pull/19782/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) | `66.66% <ø> (ø)` | |
   | [...dashboard/components/menu/ShareMenuItems/index.tsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL21lbnUvU2hhcmVNZW51SXRlbXMvaW5kZXgudHN4) | `81.81% <0.00%> (ø)` | |
   | [superset-frontend/src/dashboard/constants.ts](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb25zdGFudHMudHM=) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.tsx](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLnRzeA==) | `79.80% <ø> (ø)` | |
   | [superset/charts/commands/importers/v1/\_\_init\_\_.py](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2ltcG9ydGVycy92MS9fX2luaXRfXy5weQ==) | `44.89% <ø> (-55.11%)` | :arrow_down: |
   | [superset/dao/base.py](https://codecov.io/gh/apache/superset/pull/19782/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-c3VwZXJzZXQvZGFvL2Jhc2UucHk=) | `68.96% <ø> (-26.44%)` | :arrow_down: |
   | ... and [309 more](https://codecov.io/gh/apache/superset/pull/19782/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) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19782?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/19782?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 [b7759e6...262f8bc](https://codecov.io/gh/apache/superset/pull/19782?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] zhaoyongjie commented on a diff in pull request #19782: fix: chart import error with virtual dataset

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


##########
superset/charts/commands/importers/v1/__init__.py:
##########
@@ -89,9 +89,7 @@ def _import(
                 config.update(
                     {
                         "datasource_id": dataset.id,
-                        "datasource_type": "view"
-                        if dataset.is_sqllab_view
-                        else "table",
+                        "datasource_type": "table",

Review Comment:
   I am not familiar with this part, but the `datasource_type = view` seems the correct value here. Here is the schema [defination](https://github.com/apache/superset/blob/22a92ed72278d45049cc33eba5219d215625e4d9/superset/charts/schemas.py#L199-L203) for updating chart.
   
   @betodealmeida could you take a look?



-- 
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] rusackas merged pull request #19782: fix: chart import error with virtual dataset

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


-- 
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] rusackas commented on pull request #19782: fix: chart import error with virtual dataset

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

   Not sure why that logic was there in the first place.... @diegomedina248 or @zhaoyongjie do you see any risks here we're not aware of?


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