Skip to content

Commit

Permalink
Report deprecation warning for components=True from outside daf_butler
Browse files Browse the repository at this point in the history
Reporting the warning from _manager.py does not tell the user
what they did to trigger the warning.
  • Loading branch information
timj committed Jun 21, 2023
1 parent f7977c1 commit 71c63be
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 71c63be

Please sign in to comment.