File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,17 @@ def tuple_to_data(el: "tuple[ds.DocstringSectionKind, str]"):
160
160
161
161
@dispatch
162
162
def fields (el : BaseModel ):
163
+ # TODO: this is the only quartodoc specific code.
164
+ # pydantic seems to copy MISSING() when it's a default, so we can't
165
+ # whether a MISSING() is the default MISSING(). Instead, we'll just
166
+ # use isinstance for this particular class
167
+ from .layout import MISSING
168
+
163
169
# return fields whose values were not set to the default
164
170
field_defaults = {mf .name : mf .default for mf in el .__fields__ .values ()}
165
- return [k for k , v in el if field_defaults [k ] is not v ]
171
+ return [
172
+ k for k , v in el if field_defaults [k ] is not v if not isinstance (v , MISSING )
173
+ ]
166
174
167
175
168
176
@dispatch
You can’t perform that action at this time.
0 commit comments