From d5963689b684ea98679abcd70bfea00bf5c44365 Mon Sep 17 00:00:00 2001 From: Joohwan Oh Date: Tue, 8 Oct 2019 14:24:47 -0700 Subject: [PATCH] Fix KeyError bug in format_index function --- arango/formatter.py | 6 ++++-- arango/version.py | 2 +- setup.cfg | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arango/formatter.py b/arango/formatter.py index 21ac44b6..2e6b8663 100644 --- a/arango/formatter.py +++ b/arango/formatter.py @@ -12,10 +12,12 @@ def format_index(body): # pragma: no cover """ result = { 'id': body['id'].split('/', 1)[-1], - 'name': body['name'], - 'type': body['type'], 'fields': body['fields'] } + if 'type' in body: + result['type'] = body['type'] + if 'name' in body: + result['name'] = body['name'] if 'deduplicate' in body: result['deduplicate'] = body['deduplicate'] if 'sparse' in body: diff --git a/arango/version.py b/arango/version.py index f279ec92..4dc2ef26 100644 --- a/arango/version.py +++ b/arango/version.py @@ -1 +1 @@ -__version__ = '5.2.0' +__version__ = '5.2.1' diff --git a/setup.cfg b/setup.cfg index f93038ad..2a9acf13 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,2 @@ [bdist_wheel] universal = 1 - -[coverage:run] -omit = arango/collection.py \ No newline at end of file