You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apis/python/src/tiledb/vector_search/index.py
+89-4Lines changed: 89 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
importjson
3
3
importos
4
4
importtime
5
+
fromabcimportABCMeta
6
+
fromabcimportabstractmethod
5
7
fromtypingimportAny, Mapping, Optional
6
8
7
9
fromtiledb.cloud.dagimportMode
@@ -16,7 +18,7 @@
16
18
DATASET_TYPE="vector_search"
17
19
18
20
19
-
classIndex:
21
+
classIndex(metaclass=ABCMeta):
20
22
"""
21
23
Abstract Vector Index class.
22
24
@@ -42,22 +44,26 @@ class Index:
42
44
If `False`, load index data in main memory locally. Note that you can still use a taskgraph for query execution, you'll just end up loading the data both on your local machine and in the cloud taskgraph.
43
45
"""
44
46
47
+
@abstractmethod
45
48
def__init__(
46
49
self,
47
50
uri: str,
48
-
open_for_remote_query_execution: bool,
51
+
open_for_remote_query_execution: bool=False,
49
52
config: Optional[Mapping[str, Any]] =None,
50
53
timestamp=None,
54
+
group: tiledb.Group=None,
51
55
):
52
56
# If the user passes a tiledb python Config object convert to a dictionary
Retrieves the `index_type` from the index group metadata and instantiates the appropriate `Index` subclass.
885
+
886
+
Parameters
887
+
----------
888
+
uri: str
889
+
URI of the index.
890
+
config: Optional[Mapping[str, Any]]
891
+
TileDB config dictionary.
892
+
timestamp: int or tuple(int)
893
+
If int, open the index at a given timestamp.
894
+
If tuple, open at the given start and end timestamps.
895
+
open_for_remote_query_execution: bool
896
+
If `True`, do not load any index data in main memory locally, and instead load index data in the TileDB Cloud taskgraph created when a non-`None` `driver_mode` is passed to `query()`.
897
+
If `False`, load index data in main memory locally. Note that you can still use a taskgraph for query execution, you'll just end up loading the data both on your local machine and in the cloud taskgraph.
898
+
kwargs:
899
+
Additional arguments to be passed to the `Index` subclass constructor.
# TODO(SC-48710): Add support for `open_for_remote_query_execution`. We don't leave `self.index`` as `None` because we need to be able to call index.dimensions().
# TODO(SC-48710): Add support for `open_for_remote_query_execution`. We don't leave `self.index`` as `None` because we need to be able to call index.dimensions().
0 commit comments