From 94f0a3ee10541fae2e64ae53de84c34b81d6fc24 Mon Sep 17 00:00:00 2001 From: Jim Bosch Date: Fri, 15 Mar 2024 10:56:15 -0400 Subject: [PATCH] Implement Butler._query. --- python/lsst/daf/butler/direct_butler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/lsst/daf/butler/direct_butler.py b/python/lsst/daf/butler/direct_butler.py index 057b014709..72ea246568 100644 --- a/python/lsst/daf/butler/direct_butler.py +++ b/python/lsst/daf/butler/direct_butler.py @@ -65,6 +65,7 @@ from ._timespan import Timespan from .datastore import Datastore, NullDatastore from .dimensions import DataCoordinate, Dimension +from .direct_query_driver import DirectQueryDriver from .progress import Progress from .queries import Query from .registry import ( @@ -2102,7 +2103,12 @@ def dimensions(self) -> DimensionUniverse: @contextlib.contextmanager def _query(self) -> Iterator[Query]: # Docstring inherited. - raise NotImplementedError("TODO DM-41159") + driver = DirectQueryDriver( + self._registry._db, self.dimensions, self._registry._managers, self._registry.defaults + ) + query = Query(driver) + with driver: + yield query def _preload_cache(self) -> None: """Immediately load caches that are used for common operations."""