mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: remove parse_sql (#33474)
This commit is contained in:
@@ -49,32 +49,6 @@ def test_get_text_clause_with_colon() -> None:
|
||||
assert text_clause.text == "SELECT foo FROM tbl WHERE foo = '123\\:456')"
|
||||
|
||||
|
||||
def test_parse_sql_single_statement() -> None:
|
||||
"""
|
||||
`parse_sql` should properly strip leading and trailing spaces and semicolons
|
||||
"""
|
||||
|
||||
from superset.db_engine_specs.base import BaseEngineSpec
|
||||
|
||||
queries = BaseEngineSpec.parse_sql(" SELECT foo FROM tbl ; ")
|
||||
assert queries == ["SELECT foo FROM tbl"]
|
||||
|
||||
|
||||
def test_parse_sql_multi_statement() -> None:
|
||||
"""
|
||||
For string with multiple SQL-statements `parse_sql` method should return list
|
||||
where each element represents the single SQL-statement
|
||||
"""
|
||||
|
||||
from superset.db_engine_specs.base import BaseEngineSpec
|
||||
|
||||
queries = BaseEngineSpec.parse_sql("SELECT foo FROM tbl1; SELECT bar FROM tbl2;")
|
||||
assert queries == [
|
||||
"SELECT foo FROM tbl1",
|
||||
"SELECT bar FROM tbl2",
|
||||
]
|
||||
|
||||
|
||||
def test_validate_db_uri(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
Ensures that the `validate_database_uri` method invokes the validator correctly
|
||||
|
||||
@@ -80,19 +80,6 @@ def test_kql_has_mutation(kql: str, expected: bool) -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_kql_parse_sql() -> None:
|
||||
"""
|
||||
parse_sql method should always return a list with a single element
|
||||
which is an original query
|
||||
"""
|
||||
|
||||
from superset.db_engine_specs.kusto import KustoKqlEngineSpec
|
||||
|
||||
queries = KustoKqlEngineSpec.parse_sql("let foo = 1; tbl | where bar == foo")
|
||||
|
||||
assert queries == ["let foo = 1; tbl | where bar == foo"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"target_type,expected_result",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user