Skip to content

Commit

Permalink
Fix signature generation when the method is dataclass instance.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 619368090
  • Loading branch information
chongkong authored and copybara-github committed Mar 27, 2024
1 parent b647684 commit ff989f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/tensorflow_docs/api_generator/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def generate_signature(

sig = sig.replace(parameters=params)

if dataclasses.is_dataclass(func):
if dataclasses.is_dataclass(func) and inspect.isclass(func):
sig = sig.replace(return_annotation=EMPTY)
extract_fn = _extract_class_defaults_and_annotations
else:
Expand Down

0 comments on commit ff989f0

Please sign in to comment.