akotuc opened a new issue #16791: URL: https://github.com/apache/superset/issues/16791
When I write a query into `SQLab` by hand and create a dataset using `explore` button incorrect schema (probably from the selection on the left side of SQLab screen) is assigned to the dataset. E.g. I'm a user with access to schema `A` and `B` of a database (Postgres). I select schema `A` from schema dropbox in SQLab screen and write a query select a table from schema `B`. When I click on `explore` button and save virtual dataset, schema `A` is assigned to the dataset despite query is selecting from a table from schema `B`. This allows users with acces only to schema `A` access data from schema `B`. ### Expected results I'd expect to be schema of virtual dataset in sync with schema used in the query. ### Actual results Differenct schema is assigned to virtual dataset and other is actually used in the query. #### Screenshots  #### How to reproduce the bug 1. Go to SQLab 2. Select database and schema from the left dropboxes 3. Write a query by hand selecting from a different schema. 4. Click explore and save virtual dataset 5. Check dataset - assigned schema to the dataset vs schema accessed by the query of the virtual dataset ### Environment - browser type and version: Chrome Version 93.0.4577.82 - superset version: 1.3.0 - python version: `python --version` - node.js version: `node -v` - any feature flags active: -- 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]
