Skip to content

Commit ff989f0

Browse files
chongkongcopybara-github
authored andcommitted
Fix signature generation when the method is dataclass instance.
PiperOrigin-RevId: 619368090
1 parent b647684 commit ff989f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/tensorflow_docs/api_generator/signature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def generate_signature(
580580

581581
sig = sig.replace(parameters=params)
582582

583-
if dataclasses.is_dataclass(func):
583+
if dataclasses.is_dataclass(func) and inspect.isclass(func):
584584
sig = sig.replace(return_annotation=EMPTY)
585585
extract_fn = _extract_class_defaults_and_annotations
586586
else:

0 commit comments

Comments
 (0)