We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d507aed commit bf1fba7Copy full SHA for bf1fba7
src/oqd_dataschema/group.py
@@ -96,12 +96,15 @@ def __init_subclass__(cls, **kwargs):
96
super().__init_subclass__(**kwargs)
97
98
for k, v in cls.__annotations__.items():
99
- if k in ["class_", "attrs"]:
+ if k == "class_":
100
+ raise AttributeError("`class_` attribute should not be set manually.")
101
+
102
+ if k == "attrs" and v is not Attrs:
103
raise AttributeError(
- "`class_` and `attrs` attribute should not be set manually."
104
+ "`attrs` attribute must have type annotation of Attrs."
105
)
106
- if cls._is_classvar(v):
107
+ if k == "attrs" or cls._is_classvar(v):
108
continue
109
110
if not cls._is_groupfield_type(v):
0 commit comments