From 9615e6889c349e72af2b1ffa979f8498e8fe4cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D1=82=D1=8B=D0=BD=D0=BE=D0=B2=20=D0=9C?= =?UTF-8?q?=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=B5=D1=80=D0=B3=D0=B5?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 12 Dec 2023 10:05:21 +0000 Subject: [PATCH] [DOP-11365] Add explicit order_by to dataframe assertion --- .../test_file_format_integration/test_csv_integration.py | 3 ++- .../test_file_format_integration/test_excel_integration.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tests_integration/test_file_format_integration/test_csv_integration.py b/tests/tests_integration/test_file_format_integration/test_csv_integration.py index 526536f1c..5dbfd20e1 100644 --- a/tests/tests_integration/test_file_format_integration/test_csv_integration.py +++ b/tests/tests_integration/test_file_format_integration/test_csv_integration.py @@ -52,10 +52,11 @@ def test_csv_reader_with_infer_schema( # csv does not have header, so columns are named like "_c0", "_c1", etc expected_df = reset_column_names(expected_df) + first_column = expected_df.schema[0].name assert read_df.schema != df.schema assert read_df.schema == expected_df.schema - assert_equal_df(read_df, expected_df, order_by="id") + assert_equal_df(read_df, expected_df, order_by=first_column) @pytest.mark.parametrize( diff --git a/tests/tests_integration/test_file_format_integration/test_excel_integration.py b/tests/tests_integration/test_file_format_integration/test_excel_integration.py index 1cb24e96a..9228abd3d 100644 --- a/tests/tests_integration/test_file_format_integration/test_excel_integration.py +++ b/tests/tests_integration/test_file_format_integration/test_excel_integration.py @@ -52,10 +52,11 @@ def test_excel_reader_with_infer_schema( # excel does not have header, so columns are named like "_c0", "_c1", etc expected_df = reset_column_names(expected_df) + first_column = expected_df.schema[0].name assert read_df.schema != df.schema assert read_df.schema == expected_df.schema - assert_equal_df(read_df, expected_df, order_by="id") + assert_equal_df(read_df, expected_df, order_by=first_column) @pytest.mark.parametrize("format", ["xlsx", "xls"])