diff --git a/python/lsst/daf/butler/registry/datasets/byDimensions/_manager.py b/python/lsst/daf/butler/registry/datasets/byDimensions/_manager.py index a92b0f4fc3..5db1b989e2 100644 --- a/python/lsst/daf/butler/registry/datasets/byDimensions/_manager.py +++ b/python/lsst/daf/butler/registry/datasets/byDimensions/_manager.py @@ -8,6 +8,7 @@ from typing import TYPE_CHECKING, Any import sqlalchemy +from lsst.utils.introspection import find_outside_stacklevel from ....core import DatasetId, DatasetIdGenEnum, DatasetRef, DatasetType, DimensionUniverse, ddl from ..._collection_summary import CollectionSummary @@ -371,7 +372,9 @@ def resolve_wildcard( for name, dataset_type in wildcard.values.items(): parent_name, component_name = DatasetType.splitDatasetTypeName(name) if component_name is not None and components_deprecated: - warnings.warn(deprecation_message, FutureWarning) + warnings.warn( + deprecation_message, FutureWarning, stacklevel=find_outside_stacklevel("lsst.daf.butler") + ) if (found_storage := self.find(parent_name)) is not None: found_parent = found_storage.datasetType if component_name is not None: