Skip to content

Commit

Permalink
[DOP-11365] Add explicit order_by to dataframe assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Dec 12, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8ec95e0 commit 9615e68
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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(
Original file line number Diff line number Diff line change
@@ -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"])

0 comments on commit 9615e68

Please sign in to comment.