Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [1.0.4]

18/11/2025

- Fix `CompareResult.is_match` property.
- Fix typo in `dictdiff` method.
- Remove redundant return statement.

## [1.0.3]

15/11/2025
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sqlalchemy-diff"
version = "1.0.3"
version = "1.0.4"
authors = [
{ name = "Fabrizio Romano", email = "gianchub@gmail.com" },
{ name = "Mark McArdle", email = "m.mc4rdle@gmail.com" },
Expand Down
3 changes: 1 addition & 2 deletions src/sqlalchemydiff/comparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _compile_errors(self) -> dict:
@property
def is_match(self):
"""Tell if comparison was a match."""
return not self.errors
return not any(self.errors.values())

def dump_result(self, filename):
"""Dump `result` dict to a file."""
Expand Down Expand Up @@ -157,4 +157,3 @@ def _get_db_info(
return inspector.inspect(engine, ignore_specs)
except InspectorNotSupported as e:
logger.warning({"engine": engine, "inspector": inspector.key, "error": e.message})
return None
2 changes: 1 addition & 1 deletion src/sqlalchemydiff/inspection/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _itemsdiff(self, items_in_one: Iterable[Mapping], items_in_two: Iterable[Map
They will be different according to which inspector is being used, but their structure
will always be consistent, like in the following example:

one = [
items_in_one = [
{
"name": "id",
"type": "INTEGER",
Expand Down
12 changes: 12 additions & 0 deletions tests/test_comparer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ def test_compare_result(self):
assert compare_result.errors == {}
assert compare_result.is_match

@pytest.mark.usefixtures("setup_db_one", "setup_db_two")
def test_compare_not_match(self, db_engine_one, db_engine_two):
comparer = Comparer(db_engine_one, db_engine_two)
result = comparer.compare()
assert not result.is_match

@pytest.mark.usefixtures("setup_db_one")
def test_compare_is_match(self, db_engine_one):
comparer = Comparer(db_engine_one, db_engine_one)
result = comparer.compare()
assert result.is_match


class TestComparer(BaseTest):
@pytest.fixture
Expand Down
Loading