SchemaDiff¶
- class felis.diff.SchemaDiff(schema_old, schema_new, table_filter=None, strip_ids=True)¶
Bases:
objectCompare two schemas using DeepDiff and print the differences.
- Parameters:
schema_old (
Schema) – The old schema to compare, typically the original schema.schema_new (
Schema) – The new schema to compare, typically the modified schema.table_filter (
list[str] |None, default:None) – A list of table names to filter on.strip_ids (
bool, default:True) – Whether to strip ‘@id’ fields from the schemas before comparison.
Notes
This class uses DeepDiff to compare two schemas and provides methods to retrieve the differences. It is designed to be extended for more structured output, such as in
FormattedSchemaDiffand would not typically be used directly.Attributes Summary
Return the differences between the two schemas.
Check if there are any differences between the two schemas.
Methods Summary
print([output_stream])Print the differences between the two schemas in raw format.
Convert differences to a structured format.
Attributes Documentation
- diff¶
Return the differences between the two schemas.
- Returns:
The differences between the two schemas.
- Return type:
- has_changes¶
Check if there are any differences between the two schemas.
- Returns:
True if there are differences, False otherwise.
- Return type:
Methods Documentation
- print(output_stream=None)¶
Print the differences between the two schemas in raw format.