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
69 lines (49 loc) · 2.25 KB
/
Copy patherrors.py
File metadata and controls
69 lines (49 loc) · 2.25 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
from colorama import Fore, Style
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 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 FeatureTableNotFoundException(FeastObjectNotFoundException):
def __init__(self, name, project=None):
if project:
super().__init__(
f"Feature table {name} does not exist in project {project}"
)
else:
super().__init__(f"Feature table {name} does not exist")
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 FeastProviderModuleImportError(Exception):
def __init__(self, module_name):
super().__init__(f"Could not import provider module '{module_name}'")
class FeastProviderClassImportError(Exception):
def __init__(self, module_name, class_name):
super().__init__(
f"Could not import provider '{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}'"
)