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

Commit afb7dd5

Browse files
committed
Adjustments
1 parent 9c16a0f commit afb7dd5

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

data_diff/databases/clickhouse.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ def cursor(self, cursor_factory=None):
6262
return self.cursors[0]
6363

6464
try:
65-
connection = SingleConnection(**self._args)
66-
return connection
65+
return SingleConnection(**self._args)
6766
except clickhouse.OperationError as e:
6867
raise ConnectError(*e.args) from e
6968

7069
def _parse_type_repr(self, type_repr: str) -> Optional[Type[ColType]]:
7170
nullable_prefix = "Nullable("
7271
if type_repr.startswith(nullable_prefix):
73-
type_repr = type_repr.replace("Nullable(", "").rstrip(")")
72+
type_repr = type_repr[len(nullable_prefix):].rstrip(")")
7473

7574
if type_repr.startswith("Decimal"):
7675
type_repr = "Decimal"

data_diff/table_segment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def count_and_checksum(self) -> Tuple[int, int]:
218218

219219
if count:
220220
assert checksum, (count, checksum)
221-
return count or 0, None if not checksum else int(checksum)
221+
return count or 0, int(checksum) if count else None
222222

223223
def query_key_range(self) -> Tuple[int, int]:
224224
"""Query database for minimum and maximum key. This is used for setting the initial bounds."""

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TEST_ORACLE_CONN_STRING: str = None
2222
TEST_DATABRICKS_CONN_STRING: str = os.environ.get("DATADIFF_DATABRICKS_URI")
2323
TEST_TRINO_CONN_STRING: str = os.environ.get("DATADIFF_TRINO_URI") or None
24-
TEST_CLICKHOUSE_CONN_STRING: str = "clickhouse://clickhouse:Password1@localhost:9000/clickhouse"
24+
TEST_CLICKHOUSE_CONN_STRING: str = None # "clickhouse://clickhouse:Password1@localhost:9000/clickhouse"
2525

2626
DEFAULT_N_SAMPLES = 50
2727
N_SAMPLES = int(os.environ.get("N_SAMPLES", DEFAULT_N_SAMPLES))

0 commit comments

Comments
 (0)