/
_products.py
48 lines (33 loc) · 1.34 KB
/
_products.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2024 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
import logging
import datetime
from datacube.index.abstract import AbstractProductResource
from datacube.model import Product
from typing import Iterable
_LOG = logging.getLogger(__name__)
class ProductResource(AbstractProductResource):
def add(self, product, allow_table_lock=False):
raise NotImplementedError()
def can_update(self, product, allow_unsafe_updates=False, allow_table_lock=False):
raise NotImplementedError()
def update(self, product: Product, allow_unsafe_updates=False, allow_table_lock=False):
raise NotImplementedError()
def delete(self, product: Product):
raise NotImplementedError()
def get_unsafe(self, id_):
raise KeyError(id_)
def get_by_name_unsafe(self, name):
raise KeyError(name)
def search_robust(self, **query):
return []
def search_by_metadata(self, metadata):
return []
def get_all(self) -> Iterable[Product]:
return []
def temporal_extent(self, product: str | Product) -> tuple[datetime.datetime, datetime.datetime]:
raise KeyError(str(product))
def spatial_extent(self, product, crs=None):
raise KeyError(str(product))