Skip to content

Commit

Permalink
feat: add left_name and right_name to dataframe_diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen committed Dec 17, 2024
1 parent de52653 commit ab0e5d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tabled/compare_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def dataframe_diffs(
df1: pd.DataFrame,
df2: pd.DataFrame,
comparisons: Comparisons = DFLT_COMPARISONS,
*,
diff_condition=bool,
left_name='left',
right_name='right',
) -> dict:
"""
Compare the diff of dataframes using specified diff comparison functions.
Expand Down Expand Up @@ -148,4 +151,5 @@ def dataframe_diffs(
diff_value = comparison(df1, df2)
if diff_condition(diff_value):
diffs[name] = diff_value
diffs = diffs.rename(columns={'left': left_name, 'right': right_name})
return diffs

0 comments on commit ab0e5d1

Please sign in to comment.