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

Commit 0a18d0b

Browse files
committed
Ran black
1 parent c43f006 commit 0a18d0b

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

data_diff/databases/clickhouse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def cursor(self, cursor_factory=None):
6969
def _parse_type_repr(self, type_repr: str) -> Optional[Type[ColType]]:
7070
nullable_prefix = "Nullable("
7171
if type_repr.startswith(nullable_prefix):
72-
type_repr = type_repr[len(nullable_prefix):].rstrip(")")
72+
type_repr = type_repr[len(nullable_prefix) :].rstrip(")")
7373

7474
if type_repr.startswith("Decimal"):
7575
type_repr = "Decimal"
@@ -91,7 +91,7 @@ def to_string(self, s: str) -> str:
9191
return f"toString({s})"
9292

9393
def normalize_timestamp(self, value: str, coltype: TemporalType) -> str:
94-
prec= coltype.precision
94+
prec = coltype.precision
9595
if coltype.rounds:
9696
timestamp = f"toDateTime64(round(toUnixTimestamp64Micro(toDateTime64({value}, 6)) / 1000000, {prec}), 6)"
9797
return self.to_string(timestamp)

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-
# clickhouse uri for provided docker - "clickhouse://clickhouse:Password1@localhost:9000/clickhouse"
24+
# clickhouse uri for provided docker - "clickhouse://clickhouse:Password1@localhost:9000/clickhouse"
2525
TEST_CLICKHOUSE_CONN_STRING: str = os.environ.get("DATADIFF_CLICKHOUSE_URI") or None
2626

2727
DEFAULT_N_SAMPLES = 50

tests/test_database_types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ def init_conns():
271271
],
272272
"uuid": [
273273
"String",
274-
]
275-
}
274+
],
275+
},
276276
}
277277

278278

@@ -482,13 +482,13 @@ def _insert_to_table(conn, table, values, type):
482482
if type.startswith("DateTime64"):
483483
value = f"'{sample.replace(tzinfo=None)}'"
484484

485-
elif type == 'DateTime':
485+
elif type == "DateTime":
486486
sample = sample.replace(tzinfo=None)
487487
# Clickhouse's DateTime does not allow to store micro/milli/nano seconds
488488
value = f"'{str(sample)[:19]}'"
489489

490-
elif type.startswith('Decimal'):
491-
precision = int(type[8:].rstrip(')').split(',')[1])
490+
elif type.startswith("Decimal"):
491+
precision = int(type[8:].rstrip(")").split(",")[1])
492492
value = round(sample, precision)
493493

494494
else:

tests/test_diff_tables.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ def test_diff_sorted_by_key(self):
386386

387387
@test_per_database
388388
class TestDiffTables2(TestPerDatabase):
389-
390389
def test_diff_column_names(self):
391390
float_type = _get_float_type(self.connection)
392391

0 commit comments

Comments
 (0)