mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
fix: Trino - handle table not found in SQLLab (#26355)
Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
This commit is contained in:
@@ -517,3 +517,19 @@ def test_get_columns_expand_rows(mocker: MockerFixture):
|
||||
]
|
||||
|
||||
_assert_columns_equal(actual, expected)
|
||||
|
||||
|
||||
def test_get_indexes_no_table():
|
||||
from sqlalchemy.exc import NoSuchTableError
|
||||
|
||||
from superset.db_engine_specs.trino import TrinoEngineSpec
|
||||
|
||||
db_mock = Mock()
|
||||
inspector_mock = Mock()
|
||||
inspector_mock.get_indexes = Mock(
|
||||
side_effect=NoSuchTableError("The specified table does not exist.")
|
||||
)
|
||||
result = TrinoEngineSpec.get_indexes(
|
||||
db_mock, inspector_mock, "test_table", "test_schema"
|
||||
)
|
||||
assert result == []
|
||||
|
||||
Reference in New Issue
Block a user