From fd56d7fb4d5cc60b5b717eb17b83c81b775ed069 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Mon, 9 Dec 2024 11:52:24 -0500 Subject: [PATCH] Delegate to sphgeom to decode concatenated UnionRegions. --- python/lsst/daf/butler/ddl.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/python/lsst/daf/butler/ddl.py b/python/lsst/daf/butler/ddl.py index 3b97e701e2..007805add9 100644 --- a/python/lsst/daf/butler/ddl.py +++ b/python/lsst/daf/butler/ddl.py @@ -59,7 +59,7 @@ import astropy.time import sqlalchemy -from lsst.sphgeom import Region, UnionRegion +from lsst.sphgeom import Region from lsst.utils.iteration import ensure_iterable from sqlalchemy.dialects.postgresql import UUID @@ -181,14 +181,7 @@ def process_bind_param(self, value: Region | None, dialect: sqlalchemy.engine.Di def process_result_value(self, value: str | None, dialect: sqlalchemy.engine.Dialect) -> Region | None: if value is None: return None - regions = [ - # For some reason super() doesn't work here! - Region.decode(Base64Bytes.process_result_value(self, union_member, dialect)) - for union_member in value.split(":") - ] - if len(regions) == 1: - return regions[0] - return UnionRegion(*regions) + return Region.decodeBase64(value) @property def python_type(self) -> type[Region]: