From ac1af00c5d6ea8c6b86d1f8553b170490ab9fac3 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 16 Jan 2025 15:24:28 -0700 Subject: [PATCH] Cast astropy time MJD to float from np.float64 In numpy 2 sqlalchemy refuses to handle np.float64 and so the times must be converted to Python float. --- python/lsst/daf/butler/registry/obscore/_records.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/daf/butler/registry/obscore/_records.py b/python/lsst/daf/butler/registry/obscore/_records.py index bbd29bfadf..0e9eb40ac3 100644 --- a/python/lsst/daf/butler/registry/obscore/_records.py +++ b/python/lsst/daf/butler/registry/obscore/_records.py @@ -181,10 +181,10 @@ def __call__(self, ref: DatasetRef) -> Record | None: if timespan is not None: if timespan.begin is not None: t_min = cast(astropy.time.Time, timespan.begin) - record["t_min"] = t_min.mjd + record["t_min"] = float(t_min.mjd) if timespan.end is not None: t_max = cast(astropy.time.Time, timespan.end) - record["t_max"] = t_max.mjd + record["t_max"] = float(t_max.mjd) region = dataId.region if self.exposure.name in dataId: