From 6c7c26a8752709ee102e2551c2a12bd4d671a9f2 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Thu, 7 Nov 2024 07:45:49 -0500 Subject: [PATCH] Fix dtype deserialization --- databroker/mongo_normalized.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/databroker/mongo_normalized.py b/databroker/mongo_normalized.py index 15d258a8f..77d2be263 100644 --- a/databroker/mongo_normalized.py +++ b/databroker/mongo_normalized.py @@ -77,7 +77,8 @@ def _try_descr(field_metadata): if descr: if len(descr) == 1 and descr[0][0] == "": return None - dtype = StructDtype.from_numpy_dtype(numpy.dtype(descr)) + numpy_dtype = numpy.dtype([tuple(field) for field in descr]) + dtype = StructDtype.from_numpy_dtype(numpy_dtype) if dtype.max_depth() > 1: raise RuntimeError( "We can not yet cope with multiple nested structured dtypes. "