diff --git a/python/lsst/pipe/tasks/postprocess.py b/python/lsst/pipe/tasks/postprocess.py index 102731fa5..df583f460 100644 --- a/python/lsst/pipe/tasks/postprocess.py +++ b/python/lsst/pipe/tasks/postprocess.py @@ -1773,11 +1773,13 @@ def run(self, inputCatalogs, referenceCatalog, funcs=None, dataId=None, band=Non outputCatalog.index.rename(self.config.keyRef, inplace=True) # Add config.keyRef to the column list outputCatalog.reset_index(inplace=True) - # Set the forcedSourceId to the index. This is specified in the - # ForcedSource.yaml - outputCatalog.set_index("forcedSourceId", inplace=True, verify_integrity=True) - # Rename it to the config.key - outputCatalog.index.rename(self.config.key, inplace=True) + + if "forcedSourceId" in outputCatalog.columns: + # Set the forcedSourceId to the index. This is specified in the + # ForcedSource.yaml + outputCatalog.set_index("forcedSourceId", inplace=True, verify_integrity=True) + # Rename it to the config.key + outputCatalog.index.rename(self.config.key, inplace=True) self.log.info("Made a table of %d columns and %d rows", len(outputCatalog.columns), len(outputCatalog)) diff --git a/schemas/ForcedSource.yaml b/schemas/ForcedSource.yaml index 1967a68a3..7e5d9bc72 100644 --- a/schemas/ForcedSource.yaml +++ b/schemas/ForcedSource.yaml @@ -3,10 +3,6 @@ # `lsst.pipe.tasks.postprocess.TransformForcedSourceTableTask`. # See the DPDD for more information about the output: https://lse-163.lsst.io funcs: - forcedSourceId: - functor: Column - args: id - dataset: calexp parentObjectId: functor: Column args: parent