7
7
8
8
import deeplake
9
9
from deeplake .constants import MB , DEFAULT_VECTORSTORE_INDEX_PARAMS , TARGET_BYTE_SIZE
10
+ from deeplake .enterprise .util import INDRA_INSTALLED
10
11
from deeplake .util .exceptions import TensorDoesNotExistError
11
12
from deeplake .util .warnings import always_warn
12
13
from deeplake .core .dataset import DeepLakeCloudDataset , Dataset
@@ -41,9 +42,8 @@ def get_exec_option(self):
41
42
42
43
43
44
class ExecOptionCloudDataset (ExecOptionBase ):
44
- def __init__ (self , dataset , indra_installed , username , path_type ):
45
+ def __init__ (self , dataset , username , path_type ):
45
46
self .dataset = dataset
46
- self .indra_installed = indra_installed
47
47
self .client = dataset .client
48
48
self .token = self .dataset .token
49
49
self .username = username
@@ -59,20 +59,15 @@ def get_exec_option(self):
59
59
return "tensor_db"
60
60
# option 2: dataset is created in a linked storage or locally,
61
61
# indra is installed user/org has access to indra
62
- elif (
63
- self .path_type == "hub"
64
- and self .indra_installed
65
- and self .username != "public"
66
- ):
62
+ elif self .path_type == "hub" and INDRA_INSTALLED and self .username != "public" :
67
63
return "compute_engine"
68
64
else :
69
65
return "python"
70
66
71
67
72
68
class ExecOptionLocalDataset (ExecOptionBase ):
73
- def __init__ (self , dataset , indra_installed , username ):
69
+ def __init__ (self , dataset , username ):
74
70
self .dataset = dataset
75
- self .indra_installed = indra_installed
76
71
self .token = self .dataset .token
77
72
self .username = username
78
73
@@ -83,21 +78,21 @@ def get_exec_option(self):
83
78
if "mem://" in self .dataset .path :
84
79
return "python"
85
80
86
- if self . indra_installed and self .username != "public" :
81
+ if INDRA_INSTALLED and self .username != "public" :
87
82
return "compute_engine"
88
83
return "python"
89
84
90
85
91
- def exec_option_factory (dataset , indra_installed , username ):
86
+ def exec_option_factory (dataset , username ):
92
87
path_type = get_path_type (dataset .path )
93
88
if path_type == "local" :
94
- return ExecOptionLocalDataset (dataset , indra_installed , username )
95
- return ExecOptionCloudDataset (dataset , indra_installed , username , path_type )
89
+ return ExecOptionLocalDataset (dataset , username )
90
+ return ExecOptionCloudDataset (dataset , username , path_type )
96
91
97
92
98
- def parse_exec_option (dataset , exec_option , indra_installed , username ):
93
+ def parse_exec_option (dataset , exec_option , username ):
99
94
if exec_option is None or exec_option == "auto" :
100
- exec_option = exec_option_factory (dataset , indra_installed , username )
95
+ exec_option = exec_option_factory (dataset , username )
101
96
return exec_option .get_exec_option ()
102
97
return exec_option
103
98
@@ -136,8 +131,8 @@ def parse_return_tensors(dataset, return_tensors, embedding_tensor, return_view)
136
131
return return_tensors
137
132
138
133
139
- def check_indra_installation (exec_option , indra_installed ):
140
- if exec_option == "compute_engine" and not indra_installed :
134
+ def check_indra_installation (exec_option ):
135
+ if exec_option == "compute_engine" and not INDRA_INSTALLED :
141
136
from deeplake .enterprise .util import raise_indra_installation_error
142
137
143
138
raise raise_indra_installation_error (
0 commit comments