FormattedSchemaDiff¶
- class felis.diff.FormattedSchemaDiff(schema_old, schema_new, table_filter=[])¶
Bases:
SchemaDiffCompare two schemas using DeepDiff and emit structured JSON differences.
- Parameters:
Notes
This class extends
SchemaDiffto provide a more structured output of differences. It formats the differences into a list of dictionaries, each representing a change with details such as change type, path, and values involved.Output dictionaries representing the changes are formatted as follows:
{ "change_type": str, "id": str, "path": str, "old_value": Any (for value changes), "new_value": Any (for value changes), "value": Any (for additions/removals) }
The changes can be printed to JSON using the
printmethod.Methods Summary
print([output_stream])Print the differences between the two schemas as JSON.
Convert differences to a structured format.
Methods Documentation
- print(output_stream=None)¶
Print the differences between the two schemas as JSON.