From 81c122b8db7c7e8f309c3a29ee9cbe3a6915bea4 Mon Sep 17 00:00:00 2001 From: gbischof Date: Tue, 29 Oct 2024 12:41:04 -0400 Subject: [PATCH] pass uid to default_validate_shape --- databroker/mongo_normalized.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/databroker/mongo_normalized.py b/databroker/mongo_normalized.py index 17ca49928..15d258a8f 100644 --- a/databroker/mongo_normalized.py +++ b/databroker/mongo_normalized.py @@ -4,6 +4,7 @@ import copy from datetime import datetime, timedelta import functools +import inspect import itertools import logging import os @@ -932,6 +933,9 @@ def populate_columns(keys, min_seq_num, max_seq_num): map( lambda item: self.validate_shape( key, numpy.asarray(item), expected_shape + ) if 'uid' in inspect.signature(self.validate_shape).parameters + else self.validate_shape( + key, numpy.asarray(item), expected_shape, uid=self._run.metadata()['start']['uid'] ), result[key], ) @@ -2245,7 +2249,7 @@ def default_validate_shape(key, data, expected_shape, uid=None): logger.warning(f"The data.shape: {data.shape} did not match the expected_shape: " f"{expected_shape} for key: '{key}'. This data has been zero-padded " - "to match the expected_shape!") + "to match the expected_shape! RunStart UID: {uid}") return padded