feat: add full_log option to suppress the diff table in equality errors - #195
Open
nanjeshramesh wants to merge 1 commit into
Open
feat: add full_log option to suppress the diff table in equality errors#195nanjeshramesh wants to merge 1 commit into
nanjeshramesh wants to merge 1 commit into
Conversation
When assert_df_equality or assert_approx_df_equality fails on a wide or long DataFrame, the exception message includes the entire row-by-row diff table, which can get long enough that it's hard to read or gets truncated by the test runner. This adds an optional full_log parameter (default True, so nothing changes unless you opt in) that swaps the table for a short message when set to False. Threaded through both public entry points, the Chispa class wrapper, and both raise sites in rows_comparer.py. Added tests for the default behavior and the new short-message path on both assert_df_equality and assert_approx_df_equality, and a line in the README next to the other optional parameters. No existing behavior changes, full_log defaults to True everywhere. Closes MrPowers#43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
docsis updatedDescription of changes
Closes #43.
When assert_df_equality or assert_approx_df_equality fails on a wide or long
DataFrame, the exception message includes the full row-by-row diff table.
That's usually great, but on bigger DataFrames it can get long enough to be
hard to read or to get truncated by the test runner's output.
This adds an optional full_log parameter to both functions. It defaults to
True, so nothing changes unless you opt in. Setting it to False swaps the
table for a short "DataFrames are not equal" message instead.
Threaded through both public entry points, the Chispa class wrapper, and
both raise sites in rows_comparer.py. Added tests for the default behavior
and the new short-message path on both functions, plus a line in the README
next to the other optional parameters (ignore_metadata, transforms,
underline_cells).
Ran the full test suite, ruff, and mypy in strict mode locally, all clean.