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

Commit 2a4ea5d

Browse files
authored
Merge pull request #367 from datafold/sqeleton_0.0.3
Bump Sqeleton version to 0.0.3
2 parents 7def8f5 + 9d86bea commit 2a4ea5d

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

data_diff/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
set_entrypoint_name("CLI")
3737

38+
3839
def _remove_passwords_in_dict(d: dict):
3940
for k, v in d.items():
4041
if k == "password":

data_diff/hashdiff_tables.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from runtype import dataclass
99

10-
from sqeleton.abcs import ColType_UUID, NumericType, PrecisionType, StringType
10+
from sqeleton.abcs import ColType_UUID, NumericType, PrecisionType, StringType, Boolean
1111

1212
from .info_tree import InfoTree
1313
from .utils import safezip
@@ -94,17 +94,19 @@ def _validate_and_adjust_columns(self, table1, table2):
9494
table1._schema[c1] = col1.replace(precision=lowest.precision, rounds=lowest.rounds)
9595
table2._schema[c2] = col2.replace(precision=lowest.precision, rounds=lowest.rounds)
9696

97-
elif isinstance(col1, NumericType):
98-
if not isinstance(col2, NumericType):
97+
elif isinstance(col1, (NumericType, Boolean)):
98+
if not isinstance(col2, (NumericType, Boolean)):
9999
raise TypeError(f"Incompatible types for column '{c1}': {col1} <-> {col2}")
100100

101101
lowest = min(col1, col2, key=attrgetter("precision"))
102102

103103
if col1.precision != col2.precision:
104104
logger.warning(f"Using reduced precision {lowest} for column '{c1}'. Types={col1}, {col2}")
105105

106-
table1._schema[c1] = col1.replace(precision=lowest.precision)
107-
table2._schema[c2] = col2.replace(precision=lowest.precision)
106+
if lowest.precision != col1.precision:
107+
table1._schema[c1] = col1.replace(precision=lowest.precision)
108+
if lowest.precision != col2.precision:
109+
table2._schema[c2] = col2.replace(precision=lowest.precision)
108110

109111
elif isinstance(col1, ColType_UUID):
110112
if not isinstance(col2, ColType_UUID):

poetry.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dsnparse = "*"
2929
click = "^8.1"
3030
rich = "*"
3131
toml = "^0.10.2"
32-
sqeleton = "*"
32+
sqeleton = "^0.0.5"
3333
mysql-connector-python = {version="8.0.29", optional=true}
3434
psycopg2 = {version="*", optional=true}
3535
snowflake-connector-python = {version="^2.7.2", optional=true}

0 commit comments

Comments
 (0)