Skip to content

Commit

Permalink
feedback from OB
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusMerkleQC committed Nov 7, 2024
1 parent 7ab470b commit e43d78c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
4 changes: 2 additions & 2 deletions sqlcompyre/results/names.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def in_common(self) -> list[str]:
@cached_property
def missing_left(self) -> list[str]:
"""Ordered list of names provided only by the "right" database object."""
if self._name_mapping:
if self._name_mapping is not None:
right_renamed = {
self._inverse_name_mapping.get(k, k) for k in self._set_right
}
Expand All @@ -61,7 +61,7 @@ def missing_left(self) -> list[str]:
@cached_property
def missing_right(self) -> list[str]:
"""Ordered list of names provided only by the "left" database object."""
if self._name_mapping:
if self._name_mapping is not None:
left_renamed = {self._name_mapping.get(k, k) for k in self._set_left}
return sorted(left_renamed - self._set_right)
else:
Expand Down
40 changes: 0 additions & 40 deletions tests/analysis/table_comparison/test_column_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,6 @@ def test_column_names_equal_missing_2(engine: Engine, table_students: sa.Table):
assert not comparison.column_names.missing_right


def test_column_names_equal_missing_renamed_1(
engine: Engine,
table_students_modified_2: sa.Table,
table_students_renamed: sa.Table,
):
# Check that there are no missing columns in two different tables with renamings
comparison = sc.compare_tables(
engine,
table_students_modified_2,
table_students_renamed,
column_name_mapping={
"id": "id_v2",
"name": "name_v2",
"age": "age_v2",
"gpa": "gpa_v2",
},
)
assert not comparison.column_names.missing_left


def test_column_names_equal_missing_renamed_2(
engine: Engine,
table_students_modified_2: sa.Table,
table_students_renamed: sa.Table,
):
# Check that there are no missing columns in two different tables with renamings
comparison = sc.compare_tables(
engine,
table_students_modified_2,
table_students_renamed,
column_name_mapping={
"id": "id_v2",
"name": "name_v2",
"age": "age_v2",
"gpa": "gpa_v2",
},
)
assert not comparison.column_names.missing_right


def test_column_names_unequal_same_names(
engine: Engine,
table_students: sa.Table,
Expand Down

0 comments on commit e43d78c

Please sign in to comment.