Skip to content

Commit

Permalink
Merge pull request #1091 from lsst/tickets/DM-46601
Browse files Browse the repository at this point in the history
DM-46601: Use nanoseconds for ingest_date for new repos
  • Loading branch information
andy-slac authored Oct 7, 2024
2 parents 9600402 + 35d2c7f commit e212280
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .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-pre-commit-mirror
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -23,10 +23,10 @@ repos:
name: isort (python)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.5
rev: v0.6.8
hooks:
- id: ruff
- repo: https://github.com/numpy/numpydoc
rev: "v1.8.0rc2"
rev: "v1.8.0"
hooks:
- id: numpydoc-validation
1 change: 1 addition & 0 deletions doc/changes/DM-46601.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update default version of `datasets` manager; new Butler repositories will use TAI nanoseconds for `ingest_date` column instead of database-native timestamps.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@


# This has to be updated on every schema change
# TODO: 1.0.0 can be removed once all repos were migrated to 2.0.0.
_VERSION_UUID = VersionTuple(1, 0, 0)
# Starting with 2.0.0 the `ingest_date` column type uses nanoseconds instead
# of TIMESTAMP. The code supports both 1.0.0 and 2.0.0 for the duration of
Expand Down Expand Up @@ -572,9 +573,9 @@ def supportsIdGenerationMode(cls, mode: DatasetIdGenEnum) -> bool:
def _newDefaultSchemaVersion(cls) -> VersionTuple:
# Docstring inherited from VersionedExtension.

# By default return 1.0.0 so that older clients can still access new
# registries created with a default config.
return _VERSION_UUID
# By default return latest version so that new repos are created with
# nanoseconds ingest_date.
return _VERSION_UUID_NS

def ingest_date_dtype(self) -> type:
"""Return type of the ``ingest_date`` column."""
Expand Down

0 comments on commit e212280

Please sign in to comment.