Skip to content

Commit c248240

Browse files
pr feedback; streamline conditional
1 parent 0b5806a commit c248240

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sqlmesh/core/engine_adapter/base.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from sqlglot import Dialect, exp
2020
from sqlglot.errors import ErrorLevel
21-
from sqlglot.helper import ensure_list
21+
from sqlglot.helper import ensure_list, seq_get
2222
from sqlglot.optimizer.qualify_columns import quote_identifiers
2323

2424
from sqlmesh.core.dialect import (
@@ -1887,11 +1887,7 @@ def remove_managed_columns(
18871887
# column names and then remove them from the unmanaged_columns
18881888
if check_columns:
18891889
# Handle both Star directly and [Star()] (which can happen during serialization/deserialization)
1890-
if isinstance(check_columns, exp.Star) or (
1891-
isinstance(check_columns, list)
1892-
and len(check_columns) == 1
1893-
and isinstance(check_columns[0], exp.Star)
1894-
):
1890+
if isinstance(seq_get(ensure_list(check_columns), 0), exp.Star):
18951891
check_columns = [exp.column(col) for col in unmanaged_columns_to_types]
18961892
execution_ts = (
18971893
exp.cast(execution_time, time_data_type, dialect=self.dialect)

0 commit comments

Comments
 (0)