You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/01/28 00:34:09 UTC

[GitHub] [superset] justinpark opened a new pull request, #22896: fix(explore): unable to update linked charts

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

   ### SUMMARY
   When any random user clones a dashboard without clone charts, the original owner of the chart cannot update the chart.
   It's caused by the #21497 which starts passing the linked `dashboards` ids and the following validation logic triggered.
   
   https://github.com/apache/superset/blob/7bd2afd724799be2d5ca3edb90c5b95a56609211/superset/charts/commands/update.py#L107-L110
   
   The main problem is base `find_by_ids` applies `base_filter` which excludes the dashboard without ownership under draft status. (see the following logs)
   
   ```
   superset_app           | SELECT dashboards.uuid AS dashboards_uuid, dashboards.created_on AS dashboards_created_on, dashboards.changed_on AS dashboards_changed_on, dashboards.id AS dashboards_id, dashboards.dashboard_title AS dashboards_dashboard_title, dashboards.position_json AS dashboards_position_json, dashboards.description AS dashboards_description, dashboards.css AS dashboards_css, dashboards.certified_by AS dashboards_certified_by, dashboards.certification_details AS dashboards_certification_details, dashboards.json_metadata AS dashboards_json_metadata, dashboards.slug AS dashboards_slug, dashboards.published AS dashboards_published, dashboards.is_managed_externally AS dashboards_is_managed_externally, dashboards.external_url AS dashboards_external_url, dashboards.created_by_fk AS dashboards_created_by_fk, dashboards.changed_by_fk AS dashboards_changed_by_fk
   superset_app           | FROM dashboards
   superset_app           | WHERE dashboards.id IN (__[POSTCOMPILE_id_1]) AND (dashboards.id IN (SELECT dashboards.id
   superset_app           | FROM dashboards JOIN dashboard_user AS dashboard_user_1 ON dashboards.id = dashboard_user_1.dashboard_id JOIN ab_user ON ab_user.id = dashboard_user_1.user_id
   superset_app           | WHERE ab_user.id = %(id_2)s) OR dashboards.id IN (SELECT dashboards.id
   superset_app           | FROM dashboards LEFT OUTER JOIN (dashboard_slices AS dashboard_slices_1 JOIN slices ON slices.id = dashboard_slices_1.slice_id) ON dashboards.id = dashboard_slices_1.dashboard_id
   superset_app           | WHERE dashboards.published IS true AND true) OR dashboards.id IN (SELECT favstar.obj_id
   superset_app           | FROM favstar
   superset_app           | WHERE favstar.user_id = %(user_id_1)s AND favstar.class_name = %(class_name_1)s))
   ```
   
   Since the `DashboardsNotFoundValidation` checks the existence, this commit adds the `skip_base_filter` option on find_by_ids as `find_by_id` has and use the option for DashboardsNotFoundValidation.
   
   https://github.com/apache/superset/blob/7bd2afd724799be2d5ca3edb90c5b95a56609211/superset/dao/base.py#L56-L63
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   - Before
   
   https://user-images.githubusercontent.com/1392866/215229495-51c51f7b-0e46-4577-8e7d-7686274c86fa.mov
   
   - After:
   
   https://user-images.githubusercontent.com/1392866/215229482-acf97753-3589-4e92-8eb0-9e347ce7b297.mov
   
   
   ### TESTING INSTRUCTIONS
   
   1. Create a dashboard and a chart
   2. Login with a different user
   3. Clone the above dashboard without duplicates charts
   4. Login with the original user and edit chart
   
   ### ADDITIONAL INFORMATION
   - [ ] 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
   
   cc: @ktmud @john-bodley 


-- 
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] john-bodley merged pull request #22896: fix(explore): unable to update linked charts

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


-- 
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 #22896: fix(explore): unable to update linked charts

Posted by codecov.
codecov[bot] commented on PR #22896:
URL: https://github.com/apache/superset/pull/22896#issuecomment-1407261108

   # [Codecov](https://codecov.io/gh/apache/superset/pull/22896?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 [#22896](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1e85ab5) into [master](https://codecov.io/gh/apache/superset/commit/3fd4718ecb8be2012429bac8a6132f18d8ab7d4a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3fd4718) will **decrease** coverage by `1.41%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #22896      +/-   ##
   ==========================================
   - Coverage   67.34%   65.93%   -1.41%     
   ==========================================
     Files        1880     1875       -5     
     Lines       72144    72000     -144     
     Branches     7902     7902              
   ==========================================
   - Hits        48582    47472    -1110     
   - Misses      21531    22497     +966     
     Partials     2031     2031              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.62% <66.66%> (-0.03%)` | :arrow_down: |
   | mysql | `78.53% <100.00%> (-0.11%)` | :arrow_down: |
   | postgres | `78.60% <100.00%> (-0.11%)` | :arrow_down: |
   | presto | `52.51% <66.66%> (-0.03%)` | :arrow_down: |
   | python | `79.05% <100.00%> (-2.89%)` | :arrow_down: |
   | sqlite | `76.92% <100.00%> (-0.13%)` | :arrow_down: |
   | unit | `?` | |
   
   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/22896?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/charts/commands/update.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `90.00% <100.00%> (+1.42%)` | :arrow_up: |
   | [superset/dao/base.py](https://codecov.io/gh/apache/superset/pull/22896?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=) | `95.45% <100.00%> (+2.67%)` | :arrow_up: |
   | [...set/advanced\_data\_type/plugins/internet\_address.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvYWR2YW5jZWRfZGF0YV90eXBlL3BsdWdpbnMvaW50ZXJuZXRfYWRkcmVzcy5weQ==) | `16.32% <0.00%> (-79.60%)` | :arrow_down: |
   | [superset/utils/pandas\_postprocessing/boxplot.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2JveHBsb3QucHk=) | `20.51% <0.00%> (-79.49%)` | :arrow_down: |
   | [superset/charts/post\_processing.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY2hhcnRzL3Bvc3RfcHJvY2Vzc2luZy5weQ==) | `11.76% <0.00%> (-77.95%)` | :arrow_down: |
   | [...perset/advanced\_data\_type/plugins/internet\_port.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvYWR2YW5jZWRfZGF0YV90eXBlL3BsdWdpbnMvaW50ZXJuZXRfcG9ydC5weQ==) | `18.75% <0.00%> (-77.09%)` | :arrow_down: |
   | [superset/utils/pandas\_postprocessing/rolling.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3JvbGxpbmcucHk=) | `21.87% <0.00%> (-68.75%)` | :arrow_down: |
   | [...perset/utils/pandas\_postprocessing/contribution.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL2NvbnRyaWJ1dGlvbi5weQ==) | `34.61% <0.00%> (-65.39%)` | :arrow_down: |
   | [superset/utils/pandas\_postprocessing/resample.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3Jlc2FtcGxlLnB5) | `37.50% <0.00%> (-62.50%)` | :arrow_down: |
   | [superset/utils/pandas\_postprocessing/select.py](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvcGFuZGFzX3Bvc3Rwcm9jZXNzaW5nL3NlbGVjdC5weQ==) | `38.46% <0.00%> (-61.54%)` | :arrow_down: |
   | ... and [97 more](https://codecov.io/gh/apache/superset/pull/22896?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] john-bodley commented on pull request #22896: fix(explore): unable to update linked charts

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

   I guess the gist of what Superset is trying to do is to try to ensure that users are cognizant (or potentially forbidden) that updating a chart could impact numerous dashboards which the various dashboard owners are oblivious to, i.e., their dashboard now includes a chart which has been augmented in some way which is now either mislead or wrong in the context of their dashboard.
   
   Personally I find the whole Superset permission system rather complex (especially given AFAIK there's no explicit/serialized form of the policy). I'm supportive of said change, but would like some additional eyes to ensure we're not violating some rule—though the pass unit/integration tests gives be confidence that we're not.
   
   Maybe @michael-s-molina or @villebro who likely know how this _should_ work could also review the change.


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