Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker committed Nov 2, 2023
1 parent 13e6537 commit d27841b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions archive_query_log/cli/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,12 @@ def build(
unit="batch",
)
actions_providers = chain.from_iterable(action_batches_providers)
responses_providers: Iterable[tuple[bool, Any]] = bulk(
success, info = bulk(
client=config.es.client,
actions=actions_providers,
)
for success, info in responses_providers:
if not success:
raise RuntimeError(f"Indexing error: {info}")
if not success:
raise RuntimeError(f"Indexing error: {info}")
Source.index().refresh(using=config.es.client)
else:
echo("No new/changed providers.")
3 changes: 2 additions & 1 deletion archive_query_log/utils/es.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def safe_iter_scan(it: Iterable[DocumentType]) -> Iterator[DocumentType]:
for doc in it:
yield doc
except NotFoundError as e:
if (e.info is not None and "error" in e.info and
if (e.info is not None and isinstance(e.info, dict) and
"error" in e.info and
isinstance(e.info["error"], dict) and
"root_cause" in e.info["error"] and
isinstance(e.info["error"]["root_cause"], list) and
Expand Down

0 comments on commit d27841b

Please sign in to comment.