tabulardelta.comparators.sqlcompyre_comparator module
- class tabulardelta.comparators.sqlcompyre_comparator.SqlCompyreComparator(engine: Engine, join_columns: list[str] | None = None, row_samples: int = 10, value_samples: int = 50, float_precision: float = 1e-06, warning_threshold: int = 10000)[source]
Bases:
object
Implements
Comparator
protocol for comparing SQL Tables.This is mostly a wrapper for SQLCompyre’s table comparison.
- Attributes:
- join_columns
Methods
compare(self, old: sa.Table | str, new: sa.Table | str) -> TabularDelta:
Compare two SQL tables
- compare(old: Table | str, new: Table | str) TabularDelta [source]
Compare two SQL tables.
- Arguments:
- old
sa.Table
|str
: The old table (first table to compare).
- new
sa.Table
|str
: The new table (second table to compare).
- old
- Returns
TabularDelta
: Metadata and results of the comparison.
- engine: Engine
SQLAlchemy engine to connect to the database.
- float_precision: float = 1e-06
Relative precision for comparing floats.
- join_columns: list[str] | None = None
Columns to join the two tables on.
If None, SQLCompyre will try to infer them.
- row_samples: int = 10
Number of example rows to sample.
- value_samples: int = 50
Number of example value changes to sample.
- warning_threshold: int = 10000
Minimal number of rows to warn about when comparing tables.