Skip to content

Commit

Permalink
Moving elasticsearch import inside local function - maybe we should m…
Browse files Browse the repository at this point in the history
…ake elasticsearch python client a dependency.
  • Loading branch information
cyrus0824 committed Apr 13, 2017
1 parent b7459d9 commit 7cdcf4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion biothings/www/api/es/query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from elasticsearch import NotFoundError, RequestError, TransportError
from biothings.utils.common import dotdict
import logging

Expand All @@ -22,6 +21,7 @@ def __init__(self, client, options=dotdict()):

def _scroll(self, query_kwargs):
''' Returns the next scroll batch for the given scroll id '''
from elasticsearch import NotFoundError, RequestError, TransportError
try:
return self.client.scroll(**query_kwargs)
except (NotFoundError, RequestError, TransportError):
Expand Down

0 comments on commit 7cdcf4a

Please sign in to comment.