Skip to content

Commit

Permalink
appease mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariana Barzinpour committed Oct 22, 2024
1 parent 2be0e00 commit 85ab5c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion datacube/drivers/postgres/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def _ob_exprs(o):
if not source_exprs:
return (
select(
*select_columns
*select_columns # type: ignore[arg-type]
).select_from(
from_expression
).where(
Expand Down
7 changes: 4 additions & 3 deletions datacube/index/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from uuid import UUID
from datetime import timedelta
from deprecat import deprecat
from sqlalchemy import Function

from odc.geo import CRS, Geometry
from datacube.cfg.api import ODCEnvironment, ODCOptionHandler
Expand Down Expand Up @@ -1763,7 +1764,7 @@ def search_returning(self,
custom_offsets: Mapping[str, Offset] | None = None,
limit: int | None = None,
archived: bool | None = False,
order_by: Iterable[str | Field | None] = None,
order_by: Iterable[str | Field | Function] | None = None,
**query: QueryField
) -> Iterable[tuple]:
"""
Expand All @@ -1783,8 +1784,8 @@ def search_returning(self,
:param archived: False (default): Return active datasets only.
None: Include archived and active datasets.
True: Return archived datasets only.
:param order_by: a field name or field by which to sort output. None is unsorted and may allow faster return
of first result depending on the index driver's implementation.
:param order_by: a field name, field, or function by which to sort output. None is unsorted and may allow
faster return of first result depending on the index driver's implementation.
:param geopolygon: Spatial search polygon (only supported if index supports_spatial_indexes)
:param query: search query parameters
:return: Namedtuple of requested fields, for each matching dataset.
Expand Down
3 changes: 2 additions & 1 deletion datacube/index/memory/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from time import monotonic
from typing import (Any, Callable, Iterable, Mapping, Sequence, cast)
from uuid import UUID
from sqlalchemy import Function

from datacube.migration import ODC2DeprecationWarning
from datacube.index import fields
Expand Down Expand Up @@ -607,7 +608,7 @@ def search_returning(self,
custom_offsets: Mapping[str, Offset] | None = None,
limit: int | None = None,
archived: bool | None = False,
order_by: str | Field | None = None,
order_by: Iterable[str | Field | Function] | None = None,
**query: QueryField) -> Iterable[tuple]:
if "geopolygon" in query:
raise NotImplementedError("Spatial search index API not supported by this index.")
Expand Down

0 comments on commit 85ab5c2

Please sign in to comment.