Skip to content

Commit 6a080a2

Browse files
Resolve linting errors from black
1 parent fdcd94f commit 6a080a2

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

tests/test_opensearch.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ def test_get_all_aliased_indexes_for_source(test_opensearch_client):
186186

187187
@my_vcr.use_cassette("get_all_aliased_indexes_for_source_no_aliases.yaml")
188188
def test_get_all_aliased_indexes_for_source_no_aliases(test_opensearch_client):
189-
assert list(tim_os.get_indexes(test_opensearch_client).keys()) == [
190-
"testsource-index"
191-
]
189+
assert list(tim_os.get_indexes(test_opensearch_client).keys()) == ["testsource-index"]
192190
assert tim_os.get_aliases(test_opensearch_client) is None
193191
assert (
194192
tim_os.get_all_aliased_indexes_for_source(test_opensearch_client, "testsource")
@@ -350,9 +348,7 @@ def test_get_primary_index_for_source(test_opensearch_client):
350348

351349
@my_vcr.use_cassette("get_primary_index_for_source_no_primary_index.yaml")
352350
def test_get_primary_index_for_source_no_primary_index(test_opensearch_client):
353-
assert (
354-
"test-2022-10-01t00-00-00" in tim_os.get_indexes(test_opensearch_client).keys()
355-
)
351+
assert "test-2022-10-01t00-00-00" in tim_os.get_indexes(test_opensearch_client).keys()
356352
aliases = tim_os.get_aliases(test_opensearch_client)
357353
assert aliases[PRIMARY_ALIAS] == [ # pylint: disable=unsubscriptable-object
358354
"othersource-index"

tim/cli.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ def create(ctx: click.Context, index: Optional[str], source: Optional[str]) -> N
143143
"Only one of --index and --source options is allowed, not both."
144144
)
145145
if not any(options):
146-
raise click.UsageError(
147-
"Must provide either a name or source for the new index."
148-
)
146+
raise click.UsageError("Must provide either a name or source for the new index.")
149147
if source:
150148
index = helpers.generate_index_name(source)
151149
try:
@@ -207,9 +205,7 @@ def demote(ctx: click.Context, index: str) -> None:
207205
client = ctx.obj["CLIENT"]
208206
index_aliases = tim_os.get_index_aliases(client, index) or []
209207
if not index_aliases:
210-
click.echo(
211-
f"Index '{index}' has no aliases, please check aliases and try again."
212-
)
208+
click.echo(f"Index '{index}' has no aliases, please check aliases and try again.")
213209
raise click.Abort()
214210
if PRIMARY_ALIAS in index_aliases:
215211
if not helpers.confirm_action(

tim/opensearch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,7 @@ def bulk_delete(
361361
return result
362362

363363

364-
def bulk_index(
365-
client: OpenSearch, index: str, records: Iterator[dict]
366-
) -> dict[str, int]:
364+
def bulk_index(client: OpenSearch, index: str, records: Iterator[dict]) -> dict[str, int]:
367365
"""Indexes records into an existing index using the streaming bulk helper.
368366
369367
This action function uses the OpenSearch "index" action, which is a

0 commit comments

Comments
 (0)