feat: deprecate /superset/validate_sql_json migrate to api v1 (#19935)

* feat: deprecate /superset/validate_sql_json migrate to api v1

* use new error handling

* migrate SQLLAb frontend and add tests

* debug test

* debug test

* fix frontend test on sqllab

* fix tests

* fix frontend test on sqllab

* fix tests

* fix tests

* fix tests

* fix tests
This commit is contained in:
Daniel Vaz Gaspar
2022-05-10 21:25:39 +01:00
committed by GitHub
parent 9376940282
commit 87a4379d0a
9 changed files with 464 additions and 20 deletions

View File

@@ -48,13 +48,16 @@ class TestSqlValidatorEndpoint(SupersetTestCase):
def tearDown(self):
self.logout()
@patch.dict(
"superset.config.SQL_VALIDATORS_BY_ENGINE",
{},
clear=True,
)
def test_validate_sql_endpoint_noconfig(self):
"""Assert that validate_sql_json errors out when no validators are
configured for any db"""
self.login("admin")
app.config["SQL_VALIDATORS_BY_ENGINE"] = {}
resp = self.validate_sql(
"SELECT * FROM birth_names", client_id="1", raise_on_error=False
)
@@ -231,6 +234,11 @@ class TestPrestoValidator(SupersetTestCase):
self.assertEqual(1, len(errors))
@patch.dict(
"superset.config.SQL_VALIDATORS_BY_ENGINE",
{},
clear=True,
)
def test_validate_sql_endpoint(self):
self.login("admin")
# NB this is effectively an integration test -- when there's a default