Skip to content

Commit d596368

Browse files
committed
Fix KeyError bug in format_index function
1 parent a9a465a commit d596368

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

arango/formatter.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ def format_index(body): # pragma: no cover
1212
"""
1313
result = {
1414
'id': body['id'].split('/', 1)[-1],
15-
'name': body['name'],
16-
'type': body['type'],
1715
'fields': body['fields']
1816
}
17+
if 'type' in body:
18+
result['type'] = body['type']
19+
if 'name' in body:
20+
result['name'] = body['name']
1921
if 'deduplicate' in body:
2022
result['deduplicate'] = body['deduplicate']
2123
if 'sparse' in body:

arango/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.2.0'
1+
__version__ = '5.2.1'

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
[bdist_wheel]
22
universal = 1
3-
4-
[coverage:run]
5-
omit = arango/collection.py

0 commit comments

Comments
 (0)