diff --git a/python/lsst/ap/association/packageAlerts.py b/python/lsst/ap/association/packageAlerts.py index f20a3de1..55481120 100644 --- a/python/lsst/ap/association/packageAlerts.py +++ b/python/lsst/ap/association/packageAlerts.py @@ -37,6 +37,7 @@ from lsst.pex.exceptions import InvalidParameterError import lsst.pipe.base as pipeBase from lsst.utils.timer import timeMethod +from lsst.resources import ResourcePath """Methods for packaging Apdb and Pipelines data into Avro alerts. @@ -48,8 +49,8 @@ class PackageAlertsConfig(pexConfig.Config): """ schemaFile = pexConfig.Field( dtype=str, - doc="Schema definition file for the avro alerts.", - default=alertPack.get_path_to_latest_schema() + doc="Schema definition file URI for the avro alerts.", + default=alertPack.get_uri_to_latest_schema() ) minCutoutSize = pexConfig.RangeField( dtype=int, @@ -75,7 +76,9 @@ class PackageAlertsTask(pipeBase.Task): def __init__(self, **kwargs): super().__init__(**kwargs) - self.alertSchema = alertPack.Schema.from_file(self.config.schemaFile) + uri = ResourcePath(self.config.schemaFile) + with uri.as_local() as schemaFile: + self.alertSchema = alertPack.Schema.from_file(schemaFile.ospath) os.makedirs(self.config.alertWriteLocation, exist_ok=True) @timeMethod