Skip to content

Commit e354023

Browse files
committed
Don't repeat string conversion
1 parent 29eb9e7 commit e354023

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sqlmesh/core/test/definition.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -645,15 +645,14 @@ def _create_df(
645645

646646
rows = values["rows"]
647647
if columns:
648+
columns = [str(c) for c in columns]
648649
referenced_columns = list(dict.fromkeys(col for row in rows for col in row))
649650
_raise_if_unexpected_columns(columns, referenced_columns)
650651

651652
if partial:
652-
columns = [str(c) for c in columns if str(c) in referenced_columns]
653+
columns = [c for c in columns if c in referenced_columns]
653654

654-
return pd.DataFrame.from_records(
655-
rows, columns=[str(c) for c in columns] if columns else None
656-
)
655+
return pd.DataFrame.from_records(rows, columns=columns or None)
657656

658657
def _add_missing_columns(
659658
self, query: exp.Query, all_columns: t.Optional[t.Collection[str]] = None

0 commit comments

Comments
 (0)