Skip to content

Commit

Permalink
more detailed err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Sep 26, 2023
1 parent 65de008 commit 80a6b52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions py-polars/polars/testing/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,14 @@ def assert_frame_equal(

if collect_input_frames:
if check_dtype: # check this _before_ we collect
assert left.schema == right.schema, "schema dtypes are not equal"
left_schema, right_schema = left.schema, right.schema
assert (
left_schema == right_schema
), f"lazy schemas are not equal\nleft: {left_schema}\nright: {right_schema}"
left, right = left.collect(), right.collect() # type: ignore[union-attr]

if left.shape[0] != right.shape[0]: # type: ignore[union-attr]
raise_assert_detail(objs, "Length mismatch", left.shape, right.shape) # type: ignore[union-attr]
raise_assert_detail(objs, "length mismatch", left.shape, right.shape) # type: ignore[union-attr]

if not check_row_order:
try:
Expand Down

0 comments on commit 80a6b52

Please sign in to comment.