diff --git a/python/lsst/daf/butler/queries/expression_factory.py b/python/lsst/daf/butler/queries/expression_factory.py index 3f198eaf01..a55504f2b3 100644 --- a/python/lsst/daf/butler/queries/expression_factory.py +++ b/python/lsst/daf/butler/queries/expression_factory.py @@ -471,7 +471,7 @@ def __getattr__(self, field: str) -> ScalarExpressionProxy: @property def timespan(self) -> TimespanProxy: try: - expression = tree.DimensionFieldReference(element=self._element, field="timespan") + expression = tree.DatasetFieldReference(dataset_type=self._dataset_type, field="timespan") except InvalidQueryError: raise AttributeError("timespan") return TimespanProxy(expression)