Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 4318997

Browse files
authored
Merge pull request #791 from datafold/unreachable_branch_validate_adjust
fix unreachable code branches
2 parents 0b74046 + ada9306 commit 4318997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data_diff/hashdiff_tables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _validate_and_adjust_columns(self, table1: TableSegment, table2: TableSegmen
9292
# Update schemas to minimal mutual precision
9393
col1 = table1._schema[c1]
9494
col2 = table2._schema[c2]
95-
if isinstance(col1, PrecisionType) and isinstance(col2, PrecisionType):
95+
if isinstance(col1, PrecisionType):
9696
if strict and not isinstance(col2, PrecisionType):
9797
raise TypeError(f"Incompatible types for column '{c1}': {col1} <-> {col2}")
9898

@@ -104,7 +104,7 @@ def _validate_and_adjust_columns(self, table1: TableSegment, table2: TableSegmen
104104
table1._schema[c1] = attrs.evolve(col1, precision=lowest.precision, rounds=lowest.rounds)
105105
table2._schema[c2] = attrs.evolve(col2, precision=lowest.precision, rounds=lowest.rounds)
106106

107-
elif isinstance(col1, (NumericType, Boolean)) and isinstance(col2, (NumericType, Boolean)):
107+
elif isinstance(col1, (NumericType, Boolean)):
108108
if strict and not isinstance(col2, (NumericType, Boolean)):
109109
raise TypeError(f"Incompatible types for column '{c1}': {col1} <-> {col2}")
110110

0 commit comments

Comments
 (0)