You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a data class is created using the function dataclasses.make_dataclass instead of the @dataclasses.dataclass decorator, then the docstring (and even the entire node attribute data) is empty.
To Reproduce
Applying mkdocstrings to the following file
ERROR - mkdocstrings.extension: 'docstring'
Traceback (most recent call last):
File ".../lib/python3.8/site-packages/pytkdocs/cli.py", line 205, in main
output = json.dumps(process_json(line))
File ".../lib/python3.8/site-packages/pytkdocs/cli.py", line 114, in process_json
return process_config(json.loads(json_input))
File ".../lib/python3.8/site-packages/pytkdocs/cli.py", line 91, in process_config
obj = loader.get_object_documentation(path, members)
File ".../lib/python3.8/site-packages/pytkdocs/loader.py", line 360, in get_object_documentation
root_object = self.get_class_documentation(leaf, members)
File ".../lib/python3.8/site-packages/pytkdocs/loader.py", line 531, in get_class_documentation
self.add_fields(
File ".../lib/python3.8/site-packages/pytkdocs/loader.py", line 599, in add_fields
root_object.add_child(add_method(child_node))
File ".../lib/python3.8/site-packages/pytkdocs/loader.py", line 802, in get_annotated_dataclass_field
docstring=attribute_data["docstring"],
KeyError: 'docstring'
Expected behavior
The result should be equivalent to what can be extracted from
@dataclassclassf:
x: int
Screenshots
If you are using pytkdocs through mkdocstrings: yes
If relevant, please attach a screenshot: see the code block from the 'reproduction' section above.
System (please complete the following information):
pytkdocs version [e.g. 0.2.1]: pytkdocs==0.12.0
Python version: [e.g. 3.8]: Python 3.8.12 (default, Aug 30 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux
OS: Fedora 33 5.14.18-100.fc33.x86_64
The text was updated successfully, but these errors were encountered:
Describe the bug
If a data class is created using the function
dataclasses.make_dataclass
instead of the@dataclasses.dataclass
decorator, then the docstring (and even the entire node attribute data) is empty.To Reproduce
Applying mkdocstrings to the following file
leads to the error
Expected behavior
The result should be equivalent to what can be extracted from
Screenshots
If you are using
pytkdocs
throughmkdocstrings
: yesIf relevant, please attach a screenshot: see the code block from the 'reproduction' section above.
System (please complete the following information):
pytkdocs
version [e.g. 0.2.1]:pytkdocs==0.12.0
Python 3.8.12 (default, Aug 30 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux
5.14.18-100.fc33.x86_64
The text was updated successfully, but these errors were encountered: