Skip to content

Commit

Permalink
Fixed flake/test and one small issue with get_es_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
carlvitzthum committed Jul 16, 2018
1 parent d933338 commit bb039c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dcicutils/ff_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ def get_es_metadata(uuid, es_client=None, key=None, ff_env=None):
through the es_client param to save init time.
Same auth mechanism as the other metadata functions
"""
from elasticsearch.exceptions import TransportError
if es_client is None:
# need to know ES server location and item type
auth = get_authentication_with_server(key, ff_env)
Expand All @@ -356,7 +355,7 @@ def get_es_metadata(uuid, es_client=None, key=None, ff_env=None):
elif len(es_hits) == 0:
return {}
# es_hits should only be length 1, so this is the result
return es_hits[0]
return es_hits[0]['_source']


#####################
Expand Down
2 changes: 1 addition & 1 deletion test/test_ff_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,5 @@ def test_get_es_metadata(integrated_ff):
assert res2['uuid'] == res['uuid']

# bad item returns empty dict
res = ff_utils.get_es_metadata('blahblah', 'biosource', key=integrated_ff['ff_key'])
res = ff_utils.get_es_metadata('blahblah', key=integrated_ff['ff_key'])
assert res == {}

0 comments on commit bb039c4

Please sign in to comment.