From e77a83a853726a5058bee1ad7e8a8cdfc0ca6d67 Mon Sep 17 00:00:00 2001 From: Ian Sullivan Date: Sun, 12 Jan 2025 20:42:47 -0800 Subject: [PATCH] ForcedSource 'band' must be a string --- python/lsst/ap/association/testApdb.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/lsst/ap/association/testApdb.py b/python/lsst/ap/association/testApdb.py index 8c198d2e..c474dc47 100644 --- a/python/lsst/ap/association/testApdb.py +++ b/python/lsst/ap/association/testApdb.py @@ -558,6 +558,8 @@ def runForcedMeasurement(self, diaObjects, idGenerator, visit, detector): preserveColumns.append("visit") baseForcedSources["detector"] = detector preserveColumns.append("detector") + baseForcedSources["band"] = 'noBand' + preserveColumns.append("band") baseForcedSources["diaForcedSourceId"] = [idGenerator() for i in range(len(baseForcedSources))] preserveColumns.append("diaForcedSourceId") # Fill the forced sources for each diaObject with random data @@ -595,10 +597,7 @@ def writeToApdb(self, updatedDiaObjects, associatedDiaSources, diaForcedSources, diaSourceStore = None else: diaSourceStore = dropEmptyColumns(self.schema, associatedDiaSources, tableName="DiaSource") - if diaForcedSources.empty: - diaForcedSourceStore = None - else: - diaForcedSourceStore = dropEmptyColumns(self.schema, diaForcedSources, tableName="DiaForcedSource") + diaForcedSourceStore = dropEmptyColumns(self.schema, diaForcedSources, tableName="DiaForcedSource") self.apdb.store( dateTime, diaObjectStore,