Skip to content

Commit

Permalink
Merge pull request #775 from lsst/tickets/DM-37534
Browse files Browse the repository at this point in the history
DM-37534: Remove deprecated code
  • Loading branch information
Fireye04 committed Feb 10, 2023
2 parents e76f690 + f9534f8 commit e5ed552
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 714 deletions.
4 changes: 4 additions & 0 deletions doc/changes/DM-37534.removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Remove deprecated ButlerURI.
* Remove deprecated kwargs parameter from DeferredDatasetHandle.
* Remove deprecated butler prune-collection command.
* Remove deprecated checkManagerDigests from butler registry.versions.py.
6 changes: 0 additions & 6 deletions doc/lsst.daf.butler/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ Python API reference

.. automodapi:: lsst.daf.butler
:no-main-docstr:
:skip: ButlerURI

.. py:class:: lsst.daf.butler.ButlerURI(uri)
``ButlerURI`` implementation. Exists for backwards compatibility.
New code should use `lsst.resources.ResourcePath`.

.. automodapi:: lsst.daf.butler.registry
:no-main-docstr:
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ ignore_errors = True
[mypy-lsst.daf.butler.registry.tests.*]
ignore_errors = True

[mypy-lsst.daf.butler.core._butlerUri]
ignore_errors = True

# version.py is added by scons and may not exist when we run mypy.

[mypy-lsst.daf.butler.version]
Expand Down
5 changes: 0 additions & 5 deletions python/lsst/daf/butler/_deferredDatasetHandle.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get(
component: Optional[str] = None,
parameters: Optional[dict] = None,
storageClass: str | StorageClass | None = None,
**kwargs: dict,
) -> Any:
"""Retrieves the dataset pointed to by this handle
Expand All @@ -68,10 +67,6 @@ def get(
class specified when this object was created. Specifying a
read `StorageClass` can force a different type to be returned.
This type must be compatible with the original type.
**kwargs
This argument is deprecated and only exists to support legacy
gen2 butler code during migration. It is completely ignored
and will be removed in the future.
Returns
-------
Expand Down
2 changes: 0 additions & 2 deletions python/lsst/daf/butler/cli/cmd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"config_validate",
"export_calibs",
"ingest_files",
"prune_collection",
"prune_datasets",
"query_collections",
"query_data_ids",
Expand All @@ -56,7 +55,6 @@
create,
export_calibs,
ingest_files,
prune_collection,
prune_datasets,
query_collections,
query_data_ids,
Expand Down
54 changes: 0 additions & 54 deletions python/lsst/daf/butler/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from typing import Any, cast

import click
from deprecated.sphinx import deprecated

from ... import script
from .. import utils as cmd_utils
Expand Down Expand Up @@ -201,59 +200,6 @@ def config_validate(*args: Any, **kwargs: Any) -> None:
raise click.exceptions.Exit(1)


@click.command(cls=ButlerCommand)
@repo_argument(required=True)
@collection_argument(
help=unwrap(
"""COLLECTION is the Name of the collection to remove. If this is a tagged or
chained collection, datasets within the collection are not modified unless --unstore
is passed. If this is a run collection, --purge and --unstore must be passed, and
all datasets in it are fully removed from the data repository."""
)
)
@click.option(
"--purge",
help=unwrap(
"""Permit RUN collections to be removed, fully removing datasets within them.
Requires --unstore as an added precaution against accidental deletion. Must not be
passed if the collection is not a RUN."""
),
is_flag=True,
)
@click.option(
"--unstore",
help="Remove all datasets in the collection from all datastores in which they appear.",
is_flag=True,
)
@click.option(
"--unlink",
help="Before removing the given `collection` unlink it from from this parent collection.",
multiple=True,
callback=split_commas,
)
@confirm_option()
@options_file_option()
@deprecated(
reason="Please consider using remove-collections or remove-runs instead. Will be removed after v24.",
version="v24.0",
category=FutureWarning,
)
def prune_collection(**kwargs: Any) -> None:
"""Remove a collection and possibly prune datasets within it."""
result = script.pruneCollection(**kwargs)
if result.confirm:
print("The following collections will be removed:")
result.removeTable.pprint_all(align="<")
doContinue = click.confirm(text="Continue?", default=False)
else:
doContinue = True
if doContinue:
result.onConfirmation()
print("Removed collections.")
else:
print("Aborted.")


pruneDatasets_wouldRemoveMsg = unwrap(
"""The following datasets will be removed from any datastores in which
they are present:"""
Expand Down
1 change: 0 additions & 1 deletion python/lsst/daf/butler/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from . import progress # most symbols are only used by handler implementors
from . import ddl, time_utils
from ._butlerUri import *
from ._column_categorization import *
from ._column_tags import *
from ._column_type_info import *
Expand Down
62 changes: 0 additions & 62 deletions python/lsst/daf/butler/core/_butlerUri.py

This file was deleted.

31 changes: 0 additions & 31 deletions python/lsst/daf/butler/registry/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import logging
from typing import TYPE_CHECKING, Any, Mapping, MutableMapping, Optional

from deprecated.sphinx import deprecated

from .interfaces import VersionedExtension, VersionTuple

if TYPE_CHECKING:
Expand Down Expand Up @@ -316,32 +314,3 @@ def checkManagersVersions(self, writeable: bool) -> None:
f"Configured version {version} is not compatible with stored version "
f"{storedVersion} for extension {extension.extensionName()}"
)

@deprecated(reason="Schema checksums are ignored", category=FutureWarning, version="v24.0")
def checkManagersDigests(self) -> None:
"""Compare current schema digests with digests stored in database.
Raises
------
DigestMismatchError
Raised if digests are not equal.
Notes
-----
This method is not used currently and will probably disappear in the
future as we remove schema checksums.
"""
if self._attributesEmpty:
return

for extension in self._managers.values():
digest = extension.schemaDigest()
if digest is not None:
key = self._managerDigestKey(extension)
storedDigest = self._attributes.get(key)
_LOG.debug("found manager schema digest %s=%s, current digest %s", key, storedDigest, digest)
if storedDigest != digest:
raise DigestMismatchError(
f"Current schema digest '{digest}' is not the same as stored digest "
f"'{storedDigest}' for extension {extension.extensionName()}"
)
1 change: 0 additions & 1 deletion python/lsst/daf/butler/script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from .createRepo import createRepo
from .exportCalibs import exportCalibs
from .ingest_files import ingest_files
from .pruneCollection import pruneCollection # depends on QueryDatasets
from .queryCollections import queryCollections
from .queryDataIds import queryDataIds
from .queryDatasets import QueryDatasets
Expand Down

0 comments on commit e5ed552

Please sign in to comment.