mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore: remove sqlparse (#33564)
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
# under the License.
|
||||
from datetime import datetime
|
||||
from typing import Any, Optional
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import column # noqa: F401
|
||||
@@ -93,21 +92,3 @@ def test_opendistro_sqla_column_label(original: str, expected: str) -> None:
|
||||
from superset.db_engine_specs.elasticsearch import OpenDistroEngineSpec
|
||||
|
||||
assert OpenDistroEngineSpec.make_label_compatible(original) == expected
|
||||
|
||||
|
||||
def test_opendistro_strip_comments() -> None:
|
||||
"""
|
||||
DB Eng Specs (opendistro): Test execute sql strip comments
|
||||
"""
|
||||
from superset.db_engine_specs.elasticsearch import OpenDistroEngineSpec
|
||||
|
||||
mock_database = MagicMock()
|
||||
mock_cursor = MagicMock()
|
||||
mock_cursor.execute.return_value = []
|
||||
|
||||
OpenDistroEngineSpec.execute(
|
||||
mock_cursor,
|
||||
"-- some comment \nSELECT 1\n --other comment",
|
||||
mock_database,
|
||||
)
|
||||
mock_cursor.execute.assert_called_once_with("SELECT 1\n")
|
||||
|
||||
Reference in New Issue
Block a user