forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
300 lines (216 loc) · 10.4 KB
/
errors.py
File metadata and controls
300 lines (216 loc) · 10.4 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
from typing import List, Set
from colorama import Fore, Style
class DataSourceNotFoundException(Exception):
def __init__(self, path):
super().__init__(
f"Unable to find table at '{path}'. Please check that table exists."
)
class FeastObjectNotFoundException(Exception):
pass
class EntityNotFoundException(FeastObjectNotFoundException):
def __init__(self, name, project=None):
if project:
super().__init__(f"Entity {name} does not exist in project {project}")
else:
super().__init__(f"Entity {name} does not exist")
class FeatureServiceNotFoundException(FeastObjectNotFoundException):
def __init__(self, name, project=None):
if project:
super().__init__(
f"Feature service {name} does not exist in project {project}"
)
else:
super().__init__(f"Feature service {name} does not exist")
class FeatureViewNotFoundException(FeastObjectNotFoundException):
def __init__(self, name, project=None):
if project:
super().__init__(f"Feature view {name} does not exist in project {project}")
else:
super().__init__(f"Feature view {name} does not exist")
class OnDemandFeatureViewNotFoundException(FeastObjectNotFoundException):
def __init__(self, name, project=None):
if project:
super().__init__(
f"On demand feature view {name} does not exist in project {project}"
)
else:
super().__init__(f"On demand feature view {name} does not exist")
class RequestDataNotFoundInEntityDfException(FeastObjectNotFoundException):
def __init__(self, feature_name, feature_view_name):
super().__init__(
f"Feature {feature_name} not found in the entity dataframe, but required by feature view {feature_view_name}"
)
class RequestDataNotFoundInEntityRowsException(FeastObjectNotFoundException):
def __init__(self, feature_names):
super().__init__(
f"Required request data source features {feature_names} not found in the entity rows, but required by feature views"
)
class S3RegistryBucketNotExist(FeastObjectNotFoundException):
def __init__(self, bucket):
super().__init__(f"S3 bucket {bucket} for the Feast registry does not exist")
class S3RegistryBucketForbiddenAccess(FeastObjectNotFoundException):
def __init__(self, bucket):
super().__init__(f"S3 bucket {bucket} for the Feast registry can't be accessed")
class FeastProviderLoginError(Exception):
"""Error class that indicates a user has not authenticated with their provider."""
class FeastProviderNotImplementedError(Exception):
def __init__(self, provider_name):
super().__init__(f"Provider '{provider_name}' is not implemented")
class FeastProviderNotSetError(Exception):
def __init__(self):
super().__init__("Provider is not set, but is required")
class FeastFeatureServerTypeSetError(Exception):
def __init__(self, feature_server_type: str):
super().__init__(
f"Feature server type was set to {feature_server_type}, but the type should be determined by the provider"
)
class FeastFeatureServerTypeInvalidError(Exception):
def __init__(self, feature_server_type: str):
super().__init__(
f"Feature server type was set to {feature_server_type}, but this type is invalid"
)
class FeastModuleImportError(Exception):
def __init__(self, module_name: str, class_name: str):
super().__init__(
f"Could not import module '{module_name}' while attempting to load class '{class_name}'"
)
class FeastClassImportError(Exception):
def __init__(self, module_name: str, class_name: str):
super().__init__(
f"Could not import class '{class_name}' from module '{module_name}'"
)
class FeastExtrasDependencyImportError(Exception):
def __init__(self, extras_type: str, nested_error: str):
message = (
nested_error
+ "\n"
+ f"You may need run {Style.BRIGHT + Fore.GREEN}pip install 'feast[{extras_type}]'{Style.RESET_ALL}"
)
super().__init__(message)
class FeastOfflineStoreUnsupportedDataSource(Exception):
def __init__(self, offline_store_name: str, data_source_name: str):
super().__init__(
f"Offline Store '{offline_store_name}' does not support data source '{data_source_name}'"
)
class FeatureNameCollisionError(Exception):
def __init__(self, feature_refs_collisions: List[str], full_feature_names: bool):
if full_feature_names:
collisions = [ref.replace(":", "__") for ref in feature_refs_collisions]
error_message = (
"To resolve this collision, please ensure that the feature views or their own features "
"have different names. If you're intentionally joining the same feature view twice on "
"different sets of entities, please rename one of the feature views with '.with_name'."
)
else:
collisions = [ref.split(":")[1] for ref in feature_refs_collisions]
error_message = (
"To resolve this collision, either use the full feature name by setting "
"'full_feature_names=True', or ensure that the features in question have different names."
)
feature_names = ", ".join(set(collisions))
super().__init__(
f"Duplicate features named {feature_names} found.\n{error_message}"
)
class SpecifiedFeaturesNotPresentError(Exception):
def __init__(self, specified_features: List[str], feature_view_name: str):
features = ", ".join(specified_features)
super().__init__(
f"Explicitly specified features {features} not found in inferred list of features for '{feature_view_name}'"
)
class FeastOnlineStoreInvalidName(Exception):
def __init__(self, online_store_class_name: str):
super().__init__(
f"Online Store Class '{online_store_class_name}' should end with the string `OnlineStore`.'"
)
class FeastInvalidBaseClass(Exception):
def __init__(self, class_name: str, class_type: str):
super().__init__(
f"Class '{class_name}' should have `{class_type}` as a base class."
)
class FeastOnlineStoreUnsupportedDataSource(Exception):
def __init__(self, online_store_name: str, data_source_name: str):
super().__init__(
f"Online Store '{online_store_name}' does not support data source '{data_source_name}'"
)
class FeastEntityDFMissingColumnsError(Exception):
def __init__(self, expected, missing):
super().__init__(
f"The entity dataframe you have provided must contain columns {expected}, "
f"but {missing} were missing."
)
class FeastJoinKeysDuringMaterialization(Exception):
def __init__(
self, source: str, join_key_columns: Set[str], source_columns: Set[str]
):
super().__init__(
f"The DataFrame from {source} being materialized must have at least {join_key_columns} columns present, "
f"but these were missing: {join_key_columns - source_columns} "
)
class DockerDaemonNotRunning(Exception):
def __init__(self):
super().__init__(
"The Docker Python sdk cannot connect to the Docker daemon. Please make sure you have"
"the docker daemon installed, and that it is running."
)
class RegistryInferenceFailure(Exception):
def __init__(self, repo_obj_type: str, specific_issue: str):
super().__init__(
f"Inference to fill in missing information for {repo_obj_type} failed. {specific_issue}. "
"Try filling the information explicitly."
)
class BigQueryJobStillRunning(Exception):
def __init__(self, job_id):
super().__init__(f"The BigQuery job with ID '{job_id}' is still running.")
class BigQueryJobCancelled(Exception):
def __init__(self, job_id):
super().__init__(f"The BigQuery job with ID '{job_id}' was cancelled")
class RedshiftCredentialsError(Exception):
def __init__(self):
super().__init__("Redshift API failed due to incorrect credentials")
class RedshiftQueryError(Exception):
def __init__(self, details):
super().__init__(f"Redshift SQL Query failed to finish. Details: {details}")
class EntityTimestampInferenceException(Exception):
def __init__(self, expected_column_name: str):
super().__init__(
f"Please provide an entity_df with a column named {expected_column_name} representing the time of events."
)
class InvalidEntityType(Exception):
def __init__(self, entity_type: type):
super().__init__(
f"The entity dataframe you have provided must be a Pandas DataFrame or a SQL query, "
f"but we found: {entity_type} "
)
class ConflictingFeatureViewNames(Exception):
# TODO: print file location of conflicting feature views
def __init__(self, feature_view_name: str):
super().__init__(
f"The feature view name: {feature_view_name} refers to feature views of different types."
)
class ExperimentalFeatureNotEnabled(Exception):
def __init__(self, feature_flag_name: str):
super().__init__(
f"You are attempting to use an experimental feature that is not enabled. Please run "
f"`feast alpha enable {feature_flag_name}` "
)
class RepoConfigPathDoesNotExist(Exception):
def __init__(self):
super().__init__("The repo_path attribute does not exist for the repo_config.")
class AwsLambdaDoesNotExist(Exception):
def __init__(self, resource_name: str):
super().__init__(
f"The AWS Lambda function {resource_name} should have been created properly, but does not exist."
)
class AwsAPIGatewayDoesNotExist(Exception):
def __init__(self, resource_name: str):
super().__init__(
f"The AWS API Gateway {resource_name} should have been created properly, but does not exist."
)
class IncompatibleRegistryStoreClass(Exception):
def __init__(self, actual_class: str, expected_class: str):
super().__init__(
f"The registry store class was expected to be {expected_class}, but was instead {actual_class}."
)
class FeastInvalidInfraObjectType(Exception):
def __init__(self):
super().__init__("Could not identify the type of the InfraObject.")