From 80a6b521925891e34a0b7e02a893f5681761926f Mon Sep 17 00:00:00 2001 From: Alexander Beedie Date: Tue, 26 Sep 2023 13:50:36 +0000 Subject: [PATCH] more detailed err msg --- py-polars/polars/testing/asserts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-polars/polars/testing/asserts.py b/py-polars/polars/testing/asserts.py index 37786b5aa564..ea1b6c3b967d 100644 --- a/py-polars/polars/testing/asserts.py +++ b/py-polars/polars/testing/asserts.py @@ -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: