Skip to content

Commit

Permalink
Update SasquatchDatastore for Datastore changes
Browse files Browse the repository at this point in the history
There was a slight change to the Datastore interface upstream in daf_butler -- added new methods to conform with it.
  • Loading branch information
dhirving committed Jan 12, 2024
1 parent 7184e6b commit efa2394
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
from typing import TYPE_CHECKING, Any, ClassVar

from lsst.daf.butler import DatasetRef, DatasetTypeNotSupportedError, StorageClass
from lsst.daf.butler.datastore import DatasetRefURIs, DatastoreOpaqueTable
from lsst.daf.butler.datastore import DatasetRefURIs, DatastoreConfig, DatastoreOpaqueTable
from lsst.daf.butler.datastore.generic_base import GenericBaseDatastore
from lsst.daf.butler.datastore.record_data import DatastoreRecordData
from lsst.daf.butler.registry.interfaces import DatastoreRegistryBridge
from lsst.resources import ResourcePath
from lsst.resources import ResourcePath, ResourcePathExpression

from . import SasquatchDispatcher

Expand Down Expand Up @@ -84,7 +84,7 @@ class SasquatchDatastore(GenericBaseDatastore):

def __init__(
self,
config: Config | str,
config: DatastoreConfig,
bridgeManager: DatastoreRegistryBridgeManager,
butlerRoot: str | None = None,
):
Expand All @@ -105,6 +105,18 @@ def __init__(

self._dispatcher = SasquatchDispatcher(self.restProxyUrl, self.accessToken, self.namespace)

@classmethod
def _create_from_config(
cls,
config: DatastoreConfig,
bridgeManager: DatastoreRegistryBridgeManager,
butlerRoot: ResourcePathExpression | None,
) -> SasquatchDatastore:
return SasquatchDatastore(config, bridgeManager)

def clone(self, bridgeManager: DatastoreRegistryBridgeManager) -> SasquatchDatastore:
return SasquatchDatastore(self.config, bridgeManager)

@property
def bridge(self) -> DatastoreRegistryBridge:
return self._bridge
Expand Down

0 comments on commit efa2394

Please sign in to comment.