Skip to content

Commit

Permalink
Merge pull request #43 from lsst-dm/tickets/DM-45767
Browse files Browse the repository at this point in the history
DM-45767: Use public location of CollectionType
  • Loading branch information
timj authored Aug 15, 2024
2 parents d15a6b0 + ddecfcf commit 62059b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config.log
*.pyc
*_wrap.cc
*Lib.py
_build*

# Built by sconsUtils
version.py
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -21,6 +21,6 @@ repos:
name: isort (python)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.2
rev: v0.5.7
hooks:
- id: ruff
15 changes: 10 additions & 5 deletions python/lsst/daf/butler_migrate/script/rewrite_sqlite_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@
import tempfile
from collections import defaultdict

from lsst.daf.butler import Butler, Config, DatasetAssociation, DatasetId, DatasetRef, SkyPixDimension
from lsst.daf.butler import (
Butler,
CollectionType,
Config,
DatasetAssociation,
DatasetId,
DatasetRef,
SkyPixDimension,
)
from lsst.daf.butler.datastores.fileDatastore import FileDatastore
from lsst.daf.butler.direct_butler import DirectButler
from lsst.daf.butler.registry import CollectionType
from lsst.daf.butler.registry.databases.sqlite import SqliteDatabase
from lsst.daf.butler.registry.sql_registry import SqlRegistry
from lsst.daf.butler.transfers import RepoExportContext
Expand Down Expand Up @@ -269,9 +276,7 @@ def transfer_non_datasets(source_butler: DirectButler, dest_butler: DirectButler
# export/import.
BackendClass = get_class_of(source_butler._config["repo_transfer_formats", "yaml", "export"])
backend = BackendClass(yamlBuffer)
exporter = RepoExportContext(
source_butler._registry, source_butler._datastore, backend, directory=None, transfer=None
)
exporter = RepoExportContext(source_butler, backend, directory=None, transfer=None)

# Export all the collections.
for c in source_butler.registry.queryCollections(..., flattenChains=True, includeChains=True):
Expand Down

0 comments on commit 62059b9

Please sign in to comment.