Skip to content

Commit

Permalink
Remove the simple query APIs from hybrid butler
Browse files Browse the repository at this point in the history
They are not needed because the default Butler implementation
works fine with remote butler.
  • Loading branch information
timj committed Sep 4, 2024
1 parent b2768f4 commit 999b737
Showing 1 changed file with 2 additions and 86 deletions.
88 changes: 2 additions & 86 deletions python/lsst/daf/butler/tests/hybrid_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from __future__ import annotations

from collections.abc import Collection, Iterable, Mapping, Sequence
from collections.abc import Collection, Iterable, Sequence
from contextlib import AbstractContextManager
from typing import Any, TextIO, cast

Expand All @@ -44,14 +44,7 @@
from .._storage_class import StorageClass
from .._timespan import Timespan
from ..datastore import DatasetRefURIs
from ..dimensions import (
DataCoordinate,
DataId,
DimensionElement,
DimensionGroup,
DimensionRecord,
DimensionUniverse,
)
from ..dimensions import DataCoordinate, DataId, DimensionElement, DimensionRecord, DimensionUniverse
from ..direct_butler import DirectButler
from ..queries import Query
from ..registry import Registry
Expand Down Expand Up @@ -335,83 +328,6 @@ def registry(self) -> Registry:
def query(self) -> AbstractContextManager[Query]:
return self._remote_butler.query()

def query_data_ids(
self,
dimensions: DimensionGroup | Iterable[str] | str,
*,
data_id: DataId | None = None,
where: str = "",
bind: Mapping[str, Any] | None = None,
expanded: bool = False,
order_by: Iterable[str] | str | None = None,
limit: int | None = None,
offset: int = 0,
explain: bool = True,
**kwargs: Any,
) -> list[DataCoordinate]:
return self._direct_butler.query_data_ids(
dimensions,
data_id=data_id,
where=where,
bind=bind,
expanded=expanded,
order_by=order_by,
limit=limit,
offset=offset,
explain=explain,
**kwargs,
)

def query_datasets(
self,
dataset_type: Any,
collections: str | Iterable[str] | None = None,
*,
find_first: bool = True,
data_id: DataId | None = None,
where: str = "",
bind: Mapping[str, Any] | None = None,
expanded: bool = False,
explain: bool = True,
**kwargs: Any,
) -> list[DatasetRef]:
return self._direct_butler.query_datasets(
dataset_type,
collections,
find_first=find_first,
data_id=data_id,
where=where,
bind=bind,
expanded=expanded,
explain=explain,
**kwargs,
)

def query_dimension_records(
self,
element: str,
*,
data_id: DataId | None = None,
where: str = "",
bind: Mapping[str, Any] | None = None,
order_by: Iterable[str] | str | None = None,
limit: int | None = None,
offset: int = 0,
explain: bool = True,
**kwargs: Any,
) -> list[DimensionRecord]:
return self._direct_butler.query_dimension_records(
element,
data_id=data_id,
where=where,
bind=bind,
order_by=order_by,
limit=limit,
offset=offset,
explain=explain,
**kwargs,
)

def _clone(
self,
*,
Expand Down

0 comments on commit 999b737

Please sign in to comment.