Skip to content

Commit

Permalink
re-introduce count check
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperGomes committed Nov 29, 2024
1 parent 2185aae commit fc37189
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ def assert_dataframe_and_schema(
expected.subtract(actual).show(3000, False)
raise

try:
assert actual.count() == expected.count()
except AssertionError:

if (
not feature_tests_configuration.show_columns_when_actual_and_expected_are_equal
):
actual, expected = drop_columns_if_the_same(actual, expected)

print(
f"NUMBER OF ROWS MISMATCH: Actual: {actual.count()}, Expected: {expected.count()}"
)
raise


def drop_columns_if_the_same(df1: DataFrame, df2: DataFrame) -> (DataFrame, DataFrame):
column_names = df1.columns
Expand Down

0 comments on commit fc37189

Please sign in to comment.