Skip to content

Commit 3fd4dd9

Browse files
authored
Chore: Update type annotation for pandas and pandas-stubs >= v2.3.3 (#5637)
1 parent 850c41b commit 3fd4dd9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sqlmesh/core/test/definition.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,12 @@ def _to_hashable(x: t.Any) -> t.Any:
355355
for df in _split_df_by_column_pairs(diff)
356356
)
357357
else:
358-
from pandas import MultiIndex
358+
from pandas import DataFrame, MultiIndex
359359

360360
levels = t.cast(MultiIndex, diff.columns).levels[0]
361361
for col in levels:
362-
col_diff = diff[col]
362+
# diff[col] returns a DataFrame when columns is a MultiIndex
363+
col_diff = t.cast(DataFrame, diff[col])
363364
if not col_diff.empty:
364365
table = df_to_table(
365366
f"[bold red]Column '{col}' mismatch{failed_subtest}[/bold red]",

0 commit comments

Comments
 (0)