Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-46601: Use nanoseconds for ingest_date for new repos #1091

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading