Skip to content

Commit 478e0e6

Browse files
committed
lint
1 parent b4ed144 commit 478e0e6

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

clickhouse_backend/patch/migrations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def Migration(self):
7171
# has distributed migrations enabled and a migration cluster is set.
7272
# otherwise, create a regular merge tree.
7373
if _should_distribute_migrations(self.connection):
74-
7574
has_replicas = _check_replicas(self.connection)
7675

7776
Engine = models.MergeTree
@@ -130,7 +129,9 @@ class Meta:
130129
app_label = "migrations"
131130
db_table = _get_model_table_name(self.connection)
132131
engine = models.MergeTree(order_by=("app", "name"))
133-
cluster = getattr(self.connection, "migration_cluster", None)
132+
cluster = getattr(
133+
self.connection, "migration_cluster", None
134+
)
134135

135136
def __str__(self):
136137
return "Migration %s for %s" % (self.name, self.app)

tests/migrations/test_loader.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,22 @@ def assertMigrationTablesExists(self):
9494
for db in self.databases:
9595
conn = connections[db]
9696
tables = conn.introspection.table_names()
97-
self.assertIn("django_migrations", tables, f"django_migrations table not found in {conn.alias}")
98-
self.assertIn("distributed_django_migrations", tables, f"distributed_django_migrations table not found in {conn.alias}")
97+
self.assertIn(
98+
"django_migrations",
99+
tables,
100+
f"django_migrations table not found in {conn.alias}",
101+
)
102+
self.assertIn(
103+
"distributed_django_migrations",
104+
tables,
105+
f"distributed_django_migrations table not found in {conn.alias}",
106+
)
99107

100108
def assertMigrationExists(self, conn, name, app, deleted=False):
101109
with conn.cursor() as cursor:
102-
cursor.execute(f"SELECT * FROM distributed_django_migrations where name = '{name}'")
110+
cursor.execute(
111+
f"SELECT * FROM distributed_django_migrations where name = '{name}'"
112+
)
103113
res = cursor.fetchall()
104114

105115
self.assertEqual(len(res), 1, f"Migration {name} not found in {conn.alias}")

0 commit comments

Comments
 (0)