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 2020/06/26 11:21:11 UTC

[GitHub] [incubator-superset] villebro opened a new pull request #10171: fix: return slice owners for /user_slices ep

villebro opened a new pull request #10171:
URL: https://github.com/apache/incubator-superset/pull/10171


   ### SUMMARY
   Currently chart owners can't see their own charts when adding annotation layers. This is due to the `/superset/user_slices/` endpoint only returning charts that the user has either
   - created
   - changed
   - favorited
   
   This replaces filtering by `created_by` or `changed_by` with `owners`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   ### TEST PLAN
   Local testing + CI + new tests
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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] [incubator-superset] dpgaspar commented on a change in pull request #10171: fix: return slice owners for /user_slices ep

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #10171:
URL: https://github.com/apache/incubator-superset/pull/10171#discussion_r446143671



##########
File path: superset/views/core.py
##########
@@ -1380,10 +1380,17 @@ def created_dashboards(  # pylint: disable=no-self-use
     def user_slices(  # pylint: disable=no-self-use
         self, user_id: Optional[int] = None
     ) -> FlaskResponse:
-        """List of slices a user created, or faved"""
+        """List of slices a user owns or faved"""
         if not user_id:
             user_id = g.user.id
         FavStar = models.FavStar
+

Review comment:
       We should make sure `<int:user_id>` is the current user. 
   The best solution should be to just expose `/user_slices/`, @john-bodley , @etr2460 can we remove this?
   




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

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] [incubator-superset] villebro commented on a change in pull request #10171: fix: return slice owners for /user_slices ep

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #10171:
URL: https://github.com/apache/incubator-superset/pull/10171#discussion_r446173198



##########
File path: superset/views/core.py
##########
@@ -1380,10 +1380,17 @@ def created_dashboards(  # pylint: disable=no-self-use
     def user_slices(  # pylint: disable=no-self-use
         self, user_id: Optional[int] = None
     ) -> FlaskResponse:
-        """List of slices a user created, or faved"""
+        """List of slices a user owns or faved"""
         if not user_id:
             user_id = g.user.id
         FavStar = models.FavStar
+

Review comment:
       I agree, and I was surprised by the signature. There's a few similar endpoints under `views`, perhaps tackle those in one go in a separate PR?




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

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] [incubator-superset] villebro merged pull request #10171: fix: return slice owners for /user_slices ep

Posted by GitBox <gi...@apache.org>.
villebro merged pull request #10171:
URL: https://github.com/apache/incubator-superset/pull/10171


   


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

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] [incubator-superset] dpgaspar commented on a change in pull request #10171: fix: return slice owners for /user_slices ep

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on a change in pull request #10171:
URL: https://github.com/apache/incubator-superset/pull/10171#discussion_r446187200



##########
File path: superset/views/core.py
##########
@@ -1380,10 +1380,17 @@ def created_dashboards(  # pylint: disable=no-self-use
     def user_slices(  # pylint: disable=no-self-use
         self, user_id: Optional[int] = None
     ) -> FlaskResponse:
-        """List of slices a user created, or faved"""
+        """List of slices a user owns or faved"""
         if not user_id:
             user_id = g.user.id
         FavStar = models.FavStar
+

Review comment:
       sounds good!




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

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