You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "marre (via GitHub)" <gi...@apache.org> on 2024/06/18 08:03:14 UTC

[PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   ### SUMMARY
   Adds filtering of "modified by" in the same way as for "owner".  
   Fixes #27986
   
   Example `superset_config.py` with EXTRA_RELATED_QUERY_FILTERS configured:
   ```
   # Hide all users
   def user_filter(query):
       from sqlalchemy.sql import false
       return query.filter(false())
   
   EXTRA_RELATED_QUERY_FILTERS = {
       "user": user_filter,
   }
   ```
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   Before:  
   <img width="217" alt="image" src="https://github.com/apache/superset/assets/61765/1cfb06a8-faaf-4c81-b013-777092ef2721">
   
   After:  
   <img width="233" alt="image" src="https://github.com/apache/superset/assets/61765/b6ee4039-cbd0-46a4-89bd-0ed52ccee9e3">
   
   
   ### 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 -->
   - [x] Has associated issue: #27986 
   - [ ] 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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Thanks!
   
   In what release will it be included in?


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #29287:
URL: https://github.com/apache/superset/pull/29287#issuecomment-2176622574

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/29287?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 64.70%. Comparing base [(`76d897e`)](https://app.codecov.io/gh/apache/superset/commit/76d897eaa2f9e137102bc194c2e3109c29d0348f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`e58a8a3`)](https://app.codecov.io/gh/apache/superset/commit/e58a8a34c7f87ebc7d50d102ba0aaeb8087773d6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 331 commits behind head on master.
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #29287      +/-   ##
   ==========================================
   + Coverage   60.48%   64.70%   +4.22%     
   ==========================================
     Files        1931      518    -1413     
     Lines       76236    37556   -38680     
     Branches     8568        0    -8568     
   ==========================================
   - Hits        46114    24302   -21812     
   + Misses      28017    13254   -14763     
   + Partials     2105        0    -2105     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.94% <100.00%> (-0.22%)` | :arrow_down: |
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.56% <100.00%> (-0.25%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `64.70% <100.00%> (+1.22%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/29287/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `59.25% <100.00%> (+1.62%)` | :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=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/29287?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

Posted by "bruno-santos-6 (via GitHub)" <gi...@apache.org>.
bruno-santos-6 commented on PR #29287:
URL: https://github.com/apache/superset/pull/29287#issuecomment-2263387827

   @marre, thank you! However, you mentioned that this would fix the 'Modified By' field issue, but the only field currently removing the list of users is 'Owner'.
   
   Example for the 'Owner' field:
   ![image](https://github.com/user-attachments/assets/75ab364a-a689-416d-947d-df25144f90bf)
   
   Example for the 'Modified By' field
   
   ![image](https://github.com/user-attachments/assets/5c122aec-e99c-446a-a69b-af9cb1355a72)
   
   Is there some configuration that I'm missing?
   
   from sqlalchemy.sql import false
   
     # Hide all users
     def user_filter(query):
         return query.filter(false())
           
       EXTRA_RELATED_QUERY_FILTERS = {
           "user": user_filter,
           "changed_by": user_filter
       }              


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   You have to either grab it directly from github from master branch or wait for a release where this PR will be included in. I hope it will be in 4.1.0 as it was once tagged with 4.1, but that tag has been removed. So I really don't know when this will be included in a release.


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Would love to get some feedback if this PR is considered for merging. Or if I can improve it in some way.


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Updated the "summary" of this PR with a better description and added "testing instructions"


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Running CI again :)


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Noticed that I had a typo in the first sentence of the description. I wrote "modified-by" where I intended "owner" and vice-versa. Corrected in description.


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

Posted by "bruno-santos-6 (via GitHub)" <gi...@apache.org>.
bruno-santos-6 commented on PR #29287:
URL: https://github.com/apache/superset/pull/29287#issuecomment-2269136060

   @marre  You are right, I deployed Superset using Helm on Kubernetes, and the latest version of Superset available in the official chart is 4.0.1. I will try to apply version 4.0.2


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Done! Thanks for your contribution!


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Anything else I can do to get this approved/merged?


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

Posted by "bcook-konza (via GitHub)" <gi...@apache.org>.
bcook-konza commented on PR #29287:
URL: https://github.com/apache/superset/pull/29287#issuecomment-2237422866

   This looks awesome @marre - we would also greatly benefit from this. We'll be crossing our fingers for approval soon and we'll be willing to help if any additional work is needed


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   @supersetbot unlabel 4.1


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Updated branch with master to resolve merge conflict


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   Adding a link to the PR that introduced this feature for "owner" and "group".
   https://github.com/apache/superset/pull/22526


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   @sadpandajoe Would really love to have this in 4.1...
   
   @bruno-santos-6 What version of superset are you testing with?
   
   Just pulled latest from superset/superset (master branch)
   
   # Without EXTRA_RELATED_QUERY_FILTERS
   
   Without EXTRA_RELATED_QUERY_FILTERS configured:
   
   Owner:
   ![image](https://github.com/user-attachments/assets/a738f0d7-7bf3-460e-bcf1-fc86272b0735)
   
   Modified-by:
   ![image](https://github.com/user-attachments/assets/a663898d-fdaf-46ff-866f-bae79d9ef7c5)
   
   # With EXTRA_RELATED_QUERY_FILTERS
   
   Added this to my superset_config.py:
   ```
   def user_filter(query):
       from sqlalchemy.sql import false
       return query.filter(false())
   
   EXTRA_RELATED_QUERY_FILTERS = {
       "user": user_filter,
   }
   ```
   
   Started with:
   ```
   export SUPERSET_CONFIG_PATH=./superset_config.py
   superset run -p 8088 --with-threads --reload --debugger --debug
   ```
   
   Owner after:
   ![image](https://github.com/user-attachments/assets/4663f2fa-8244-46b7-8eff-4beb9a4b3994)
   
   Modified-by after:
   ![image](https://github.com/user-attachments/assets/3bfbd7d0-2723-4631-8be0-194f0c0fdc23)
   


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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

   @supersetbot label 4.1


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


Re: [PR] fix: Add user filtering to changed_by. Fixes #27986 [superset]

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


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