Skip to content

Commit ba1e5e0

Browse files
committed
Fix _run_term_info to convert numpy types and update dict_cursor to handle non-iterable results
1 parent 85a15ed commit ba1e5e0

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/vfbquery/ha_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def _init_worker():
125125

126126
def _run_term_info(short_form):
127127
"""Execute get_term_info in a worker process. Returns JSON-serialisable dict."""
128-
return _vfb.get_term_info(short_form)
128+
result = _vfb.get_term_info(short_form)
129+
return _convert_numpy_types(result)
129130

130131

131132
def _run_query(short_form, func_name):

src/vfbquery/neo4j_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def dict_cursor(results):
2121
:return: list of dicts
2222
"""
2323
dc = []
24+
if not results or not hasattr(results, '__iter__'):
25+
return dc
2426
for n in results:
2527
# Add conditional to skip any failures
2628
if n:

0 commit comments

Comments
 (0)