Skip to content

Commit 23d964b

Browse files
authored
Merge pull request #936 from hubmapconsortium/lchoy/fix-sample-index-metadata-error
Check for existence of metadata field and ensure the value is not None
2 parents 8cacf2f + d6c610d commit 23d964b

File tree

3 files changed

+1
-101
lines changed

3 files changed

+1
-101
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ git:
55
language: python
66
python:
77
- "3.9"
8-
services:
9-
- elasticsearch
10-
before_script:
11-
- sleep 10 # Advised by https://docs.travis-ci.com/user/database-setup/#elasticsearch
128

139
# Uncomment when test against a commons github branch
1410
# also need to enable the branch github install in requirements.txt

src/hubmap_translation/addl_index_transformations/portal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _simple_clean(doc):
126126
doc[name_field] = doc[name_field].title()
127127

128128
# Clean up metadata:
129-
if 'metadata' in doc:
129+
if doc.get('metadata') is not None:
130130
metadata = doc['metadata']
131131

132132
bad_fields = [

src/hubmap_translation/addl_index_transformations/portal/test_es.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)