Comparison#

class versus.Comparison(
*,
connection: VersusConn,
handles: Mapping[str, _TableHandle],
table_id: Tuple[str, str],
by_columns: List[str],
allow_both_na: bool,
materialize_mode: str,
tables: DuckDBPyRelation,
by: DuckDBPyRelation,
intersection: DuckDBPyRelation,
unmatched_cols: DuckDBPyRelation,
unmatched_keys: DuckDBPyRelation,
unmatched_rows: DuckDBPyRelation,
common_columns: List[str],
table_columns: Mapping[str, List[str]],
diff_table: DuckDBPyRelation | None,
diff_lookup: Dict[str, int] | None,
unmatched_lookup: Dict[str, int] | None,
)#

In-memory description of how two relations differ.

Provides summary relations plus helper methods to retrieve the exact differences without materializing the full input tables.

Comparison.value_diffs

Return rows where a single column differs between the tables.

Comparison.value_diffs_stacked

Return a stacked view of value differences for multiple columns.

Comparison.weave_diffs_wide

Return a wide view of differing rows with split columns.

Comparison.weave_diffs_long

Return a long view of differing rows stacked by table.

Comparison.slice_diffs

Return rows from one table that differ in the selected columns.

Comparison.slice_unmatched

Return rows from one table whose keys are missing in the other.

Comparison.slice_unmatched_both

Return unmatched rows from both tables.

Comparison.summary

Summarize which difference categories are present.

Comparison.close

Release any temporary views or tables created for the comparison.