Skip to content

Commit 7a1331b

Browse files
committed
lint
1 parent 9423faf commit 7a1331b

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

src/semsql/builder/cli.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def powerset(iterable):
2020
() (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)
2121
"""
2222
s = list(iterable)
23-
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
23+
return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))
2424

2525

2626
@click.group()
@@ -113,14 +113,18 @@ def query(input, query):
113113

114114
@main.command()
115115
@click.argument("views", nargs=-1)
116-
@click.option("--index/--no-index",
117-
default=True,
118-
show_default=True,
119-
help="Create indexes on each column")
120-
@click.option("--full-index/--no-full-index",
121-
default=False,
122-
show_default=True,
123-
help="Create indexes on all combos of columns (powerset)")
116+
@click.option(
117+
"--index/--no-index",
118+
default=True,
119+
show_default=True,
120+
help="Create indexes on each column",
121+
)
122+
@click.option(
123+
"--full-index/--no-full-index",
124+
default=False,
125+
show_default=True,
126+
help="Create indexes on all combos of columns (powerset)",
127+
)
124128
@click.option(
125129
"--schema",
126130
"-s",
@@ -152,7 +156,9 @@ def view2table(views, schema, index: bool, full_index: bool):
152156
if full_index:
153157
for combo in powerset(colnames):
154158
if len(combo) > 1:
155-
print(f"CREATE INDEX {tn}_{'_'.join(combo)} ON {tn}({','.join(combo)});")
159+
print(
160+
f"CREATE INDEX {tn}_{'_'.join(combo)} ON {tn}({','.join(combo)});"
161+
)
156162
else:
157163
logging.info(f"No view for {cn}")
158164

0 commit comments

Comments
 (0)