Skip to content

Commit

Permalink
Disable checks of schema checksums (DM-34884)
Browse files Browse the repository at this point in the history
The code that calculates checksums is still there, will be removed when
we are sure that we never need it.
  • Loading branch information
andy-slac committed May 19, 2022
1 parent cdca06c commit 1ecbe8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand Down
9 changes: 1 addition & 8 deletions python/lsst/daf/butler/registry/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
OpaqueTableStorageManager,
StaticTablesContext,
)
from .versions import ButlerVersionsManager, DigestMismatchError
from .versions import ButlerVersionsManager

_Attributes = TypeVar("_Attributes")
_Dimensions = TypeVar("_Dimensions")
Expand Down Expand Up @@ -202,13 +202,6 @@ def loadRepo(self, database: Database) -> RegistryManagerInstances:
# verify that configured versions are compatible with schema
versions.checkManagersConfig()
versions.checkManagersVersions(database.isWriteable())
try:
versions.checkManagersDigests()
except DigestMismatchError as exc:
# potentially digest mismatch is a serious error but during
# development it could be benign, treat this as warning for
# now.
_LOG.warning(f"Registry schema digest mismatch: {exc}")
# Load content from database that we try to keep in-memory.
instances.refresh()
return instances
Expand Down
8 changes: 8 additions & 0 deletions python/lsst/daf/butler/registry/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
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,13 +318,19 @@ def checkManagersVersions(self, writeable: bool) -> None:
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
Expand Down

0 comments on commit 1ecbe8d

Please sign in to comment.