feat: add summary page support for methods and properties#363
Conversation
| }) | ||
| return | ||
|
|
||
| # if summary_type in [METHOD, PROPERTY]: |
There was a problem hiding this comment.
You can make this explicit with an elif statement, also you wouldn't need to return early above.
There was a problem hiding this comment.
Chatted offline, keeping as-is.
| name_to_use = uid | ||
| if not (class_name := yaml_data.get("class", "")): | ||
| class_name = yaml_data.get("module", "") | ||
| anchor_name = f"#{'_'.join(class_name.split('.'))}_{short_name}" |
There was a problem hiding this comment.
Does class_name.replace('.', '_') work here?
| first_summary_line += "." | ||
|
|
||
| summary_to_use = ( | ||
| f"{first_summary_line}\n\n" |
There was a problem hiding this comment.
For the case where a summary isn't found, would this create extra whitespaces? I think this would become:
\n\n
See more: ...
There was a problem hiding this comment.
For methods and functions, it definitely helps to have the newlines with or without content after the syntax.
For properties & attributes, without the extra space is slightly more preferred but not a big deal. Also c.g.c will likely strip the newlines if its just blank content, it seems.
| }) | ||
| return | ||
|
|
||
| # if summary_type in [METHOD, PROPERTY]: |
There was a problem hiding this comment.
Chatted offline, keeping as-is.
| first_summary_line += "." | ||
|
|
||
| summary_to_use = ( | ||
| f"{first_summary_line}\n\n" |
There was a problem hiding this comment.
For methods and functions, it definitely helps to have the newlines with or without content after the syntax.
For properties & attributes, without the extra space is slightly more preferred but not a big deal. Also c.g.c will likely strip the newlines if its just blank content, it seems.
| name_to_use = uid | ||
| if not (class_name := yaml_data.get("class", "")): | ||
| class_name = yaml_data.get("module", "") | ||
| anchor_name = f"#{'_'.join(class_name.split('.'))}_{short_name}" |
Continuation from #361. Adds support for Methods & Functions, Properties & Attributes.
Verified that the
summary_class.ymlis unaffected from this PR.Tested and verified the result looks good, for staging in https://cloud.google.com/python/docs/reference/bigframes/latest/summary_class, https://cloud.google.com/python/docs/reference/bigframes/latest/summary_method and https://cloud.google.com/python/docs/reference/bigframes/latest/summary_properties.
Test cases would be added for goldens, however it is currently disabled.
Towards b/263399076.