refactor: sql lab command: separate concerns into different modules (#16917)

* chore move sql_execution_context to sqllab package

* add new helper methods into base Dao

* refactor separate get existing query concern from command

* refactor separate query access validation concern

* refactor separate get query's database concern from command

* refactor separate get query rendering concern from command

* refactor sqllab_execution_context

* refactor separate creating payload for view

* chore decouple command from superset app

* fix pylint issues

* fix failed tests

* fix pylint issues

* fix failed test

* fix failed black

* fix failed black

* fix failed test
This commit is contained in:
ofekisr
2021-10-03 11:15:46 +03:00
committed by GitHub
parent f0060a63c0
commit 0d0c759cfe
15 changed files with 661 additions and 286 deletions

View File

@@ -189,7 +189,7 @@ class TestSqlLab(SupersetTestCase):
return
with mock.patch(
"superset.utils.sqllab_execution_context.get_cta_schema_name",
"superset.sqllab.sqllab_execution_context.get_cta_schema_name",
lambda d, u, s, sql: f"{u.username}_database",
):
old_allow_ctas = examples_db.allow_ctas