sqlcompyre.results package

Submodules

Module contents

class sqlcompyre.results.ColumnMatches(fraction_same: dict[str, float], mismatch_selects: dict[str, Select])[source]

Bases: object

Investigate column value changes between database tables.

fraction_same: dict[str, float]

Dictionary mapping the name of the left-table column to the fraction of joined rows for which that column has the same value in both tables.

mismatch_selects: dict[str, Select]

Dictionary mapping the name of the left-table column to a query of all joined rows for which the column does not have the same value in both tables.

class sqlcompyre.results.Counts(left: int, right: int)[source]

Bases: object

Investigate the counts of database objects.

Attributes:
diff

The absolute difference in counts.

equal

Whether the counts are the same.

fraction_left

The left count divided by the right count.

fraction_right

The right count divided by the left count.

gain_left

The left count minus the right count.

gain_right

The right count minus the left count.

property diff: int

The absolute difference in counts.

property equal: bool

Whether the counts are the same.

property fraction_left: float

The left count divided by the right count.

property fraction_right: float

The right count divided by the left count.

property gain_left: int

The left count minus the right count.

property gain_right: int

The right count minus the left count.

left: int

The counts of the “left” database object.

right: int

The counts of the “right” database object.

class sqlcompyre.results.Names(left: set[str], right: set[str], name_mapping: dict[str, str] | None, ignore_casing: bool)[source]

Bases: object

Investigate the names of database objects.

Attributes:
equal

Whether the names from both database objects overlap.

in_common

Ordered list of names provided by both database objects.

left

Ordered names from the “left” database object.

missing_left

Ordered list of names provided only by the “right” database object.

missing_right

Ordered list of names provided only by the “left” database object.

right

Ordered names from the “right” database object.

property equal: bool

Whether the names from both database objects overlap.

property in_common: list[str]

Ordered list of names provided by both database objects.

property left: list[str]

Ordered names from the “left” database object.

property missing_left: list[str]

Ordered list of names provided only by the “right” database object.

property missing_right: list[str]

Ordered list of names provided only by the “left” database object.

property right: list[str]

Ordered names from the “right” database object.

class sqlcompyre.results.RowMatches(n_unjoined_left: int, n_unjoined_right: int, n_joined_equal: int, n_joined_unequal: int, n_joined_total: int, unjoined_left: Select, unjoined_right: Select, joined_equal: Select, joined_unequal: Select, joined_total: Select)[source]

Bases: object

Investigate (un-)matched rows between database tables.

joined_equal: Select

Query for obtaining all rows that could be joined and were identical across the two tables.

joined_total: Select

Query for obtaining all rows that were joined, regardless of equality.

joined_unequal: Select

Query for obtaining all rows that could be joined but were not identical.

n_joined_equal: int

Number of rows that were joined for which the values in both tables were identical

n_joined_total: int

Number of rows that could be joined

n_joined_unequal: int

Number of rows that were joined for which the values in both tables were not identical

n_unjoined_left: int

Number of columns in the left table that could not be joined

n_unjoined_right: int

Number of columns in the right table that could not be joined

unjoined_left: Select

Query for obtaining all rows from the left table that could not be joined.

unjoined_right: Select

Query for obtaining all rows from the right table that could not be joined.