use json encoding when adding and updating results
@@ -1221,7 +1221,7 @@ class SQLAlchemySocket:
if idx not in existing_results:
# Does not exist in the database. Construct a new ResultORM
- doc = ResultORM(**result.dict(exclude={"id"}))
+ doc = ResultORM(**result.dict(exclude={"id"}, encoding="json"))
# Store in existing_results in case later records are duplicates
existing_results[idx] = doc
@@ -1312,8 +1312,8 @@ class SQLAlchemySocket:
if result.id is None:
self.logger.error("Attempted update without ID, skipping")
continue
-
- data = result.dict(exclude={"id"})
+ # must use json encoding to remove numpy arrays
+ data = result.dict(exclude={"id"}, encoding="json")
# retrieve the found item
found_db = found_dict[result.id]
