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

   ### SUMMARY
   #23118 caused a regression that made the `BaseDAO` unable to find objects if 
the base query contained joins to other tables. This is because the filter was 
often ambiguous, as the id column is the same on all tables. Interestingly this 
regression was not caught because we didn't have an integration test that 
tested updates for non-admin users that didn't have the "all_datasource_access" 
perm.
   
   This PR does the following:
   - Changes the filter in `BaseDao` to filter specifically by the 
`id_column_name` of the `model_cls`
   - Updates the non-admin chart update API integration tests to use the 
`gamma_no_csv` user instead of `alpha`. Previously this test didn't catch the 
regression, because Alpha users short circuit the base filters due to having 
"all_datasource_access". By using the `gamma_no_csv` user with explicit access 
to the examples dataset, we can ensure that the full base filter is being 
applied, and catches a potential regression. With these changes, this test 
failed on master branch.
   
   ### AFTER
   Now updating the chart works as expected:
   
   
https://user-images.githubusercontent.com/33317356/222098227-ae8b67dc-2555-4c2b-852f-197fdc17e091.mp4
   
   ### BEFORE
   Previously, the chart was not found:
   
   
https://user-images.githubusercontent.com/33317356/222098288-f8a00379-cfcc-4011-a212-2f5424c25a30.mp4
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to