tabulardelta.tabulardelta module
- class tabulardelta.tabulardelta.ChangedColumn(*args, **kwargs)[source]
Bases:
MatchedColumn,Protocol,Iterable[ChangedValue]Represents changes within the same column between the old and new table.
Use
len()to get the total number of changed values.Since this is an
Iterable[ChangedValue], it may contain examples of the changes:A
ChangedValuecan represent multiple occurrences of the same values changing.There might be fewer examples than the total number of changes (returned by
len()).- Attributes:
newThe column in the new table.
oldThe column in the old table.
Methods
__len__() -> int
Total number of changes.
__iter__() -> Iterator[ChangedValue]
Examples of value changes.
- class tabulardelta.tabulardelta.ChangedValue(*args, **kwargs)[source]
Bases:
ProtocolRepresents a change of a value.
- Attributes:
count(Positive) number of rows containing this change.
example_join_columnsMapping from column names to values represents an example row where this change occurred.
newNew value after the change.
oldPrevious value before the change.
- property count: int
(Positive) number of rows containing this change.
- property example_join_columns: Mapping[str, Any]
Mapping from column names to values represents an example row where this change occurred.
- property new: Any
New value after the change.
- property old: Any
Previous value before the change.
- class tabulardelta.tabulardelta.Column(*args, **kwargs)[source]
Bases:
ProtocolRepresents a column in a table.
- property name: str
Name of the column.
- property type: str
Data type of the column.
- class tabulardelta.tabulardelta.ColumnDelta(*args, **kwargs)[source]
Bases:
ProtocolGeneric collection of information about columns, types and their changes.
- Attributes:
addedMetadata of added columns (only in new table).
comparable_type_changedMetadata of columns with changed but comparable data types.
differencesChanged values of comparable columns.
incomparable_type_changedColumns with changed and incomparable data types, including value changes.
joinedMetadata of columns used to join the old and new table.
newMetadata of columns in the new table.
oldMetadata of columns in the old table.
removedMetadata of removed columns (only in old table).
renamedMetadata of renamed columns (matched using values and types).
- property comparable_type_changed: Sequence[MatchedColumn]
Metadata of columns with changed but comparable data types.
- property differences: Sequence[ChangedColumn]
Changed values of comparable columns.
- property incomparable_type_changed: Sequence[ChangedColumn]
Columns with changed and incomparable data types, including value changes.
All values are assumed to be different.
- property joined: Sequence[MatchedColumn]
Metadata of columns used to join the old and new table.
- property renamed: Sequence[MatchedColumn]
Metadata of renamed columns (matched using values and types).
- class tabulardelta.tabulardelta.MatchedColumn(*args, **kwargs)[source]
Bases:
ProtocolMetadata of the same column in the old and new table.
- class tabulardelta.tabulardelta.RowDelta(*args, **kwargs)[source]
Bases:
ProtocolGeneric collection of information about rows.
- Attributes:
- class tabulardelta.tabulardelta.Rows(*args, **kwargs)[source]
Bases:
Protocol,Iterable[Mapping[str,Any]]Represents multiple rows. Use
len()to get the number of represented rows.Since this is an
Iterable[Mapping[str, Any]], it may contain examples of the represented rows:A
Mapping[str, Any]maps column names to values of one row.There might be fewer examples than the number represented rows (returned by
len()).Methods
__len__() -> int
Number of represented rows.
__iter__() -> Iterator[Mapping[str, Any]]
Examples of represented rows.
- class tabulardelta.tabulardelta.TabularDelta(*args, **kwargs)[source]
Bases:
ProtocolGeneric collection of information gathered by one table comparison.
Contains metadata about the comparison,
RowDeltaandColumnDelta.- Attributes:
colsColumn comparison containing information about columns, types, and value changes.
errorsErrors collected during the comparison.
infoAdditional information collected during the comparison.
nameName of the new table and therefore the comparison.
old_nameOptional name of the old table.
rowsRow comparison containing information about row changes and examples.
warningsWarnings collected during the comparison.
- property cols: ColumnDelta
Column comparison containing information about columns, types, and value changes.
- property errors: Sequence[str]
Errors collected during the comparison.
- property info: Sequence[str]
Additional information collected during the comparison.
- property name: str
Name of the new table and therefore the comparison.
- property old_name: str | None
Optional name of the old table.
- property warnings: Sequence[str]
Warnings collected during the comparison.