-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathexc.py
46 lines (36 loc) · 1.52 KB
/
exc.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
class UnsupportedColumnType(Exception):
def __init__(self, key, type):
super().__init__(
f"Unsupported column type: `{type}` on column: `{key}`. "
+ "Possible fix: exclude this column"
)
class UnsupportedAssociationProxyTarget(Exception):
def __init__(self, key):
super().__init__(
f"Association proxy `{key}` is expected to be of form "
+ "association_proxy(relationship_name, other relationship name)"
)
class HybridPropertyNotAnnotated(Exception):
def __init__(self, key):
super().__init__(
f"Descriptor `{key}` is a hybrid property, but does not have an "
+ "annotated return type"
)
class UnsupportedDescriptorType(Exception):
def __init__(self, key):
super().__init__(
f"Descriptor `{key}` is expected to be a column, relationship, "
+ "or association proxy."
)
class InterfaceModelNotPolymorphic(Exception):
def __init__(self, model):
super().__init__(
f"Model `{model}` is not polymorphic or is not the base model of its "
+ "inheritance chain, and thus cannot be used as an interface."
)
class InvalidLocalRemotePairs(Exception):
def __init__(self, relationship_name):
super().__init__(
f"The `local_remote_pairs` for the relationship `{relationship_name}` is invalid or missing. "
+ "This is likely an issue with the library. Please report this error to the maintainers."
)