diff --git a/third_party/sphinx/ext/autosummary/templates/autosummary/class.rst b/third_party/sphinx/ext/autosummary/templates/autosummary/class.rst index 89550cb386..6651591be6 100644 --- a/third_party/sphinx/ext/autosummary/templates/autosummary/class.rst +++ b/third_party/sphinx/ext/autosummary/templates/autosummary/class.rst @@ -2,11 +2,13 @@ .. currentmodule:: {{ module }} +{% set is_pandas = module.startswith("bigframes.pandas") or module.startswith("bigframes.geopandas") %} +{% set skip_inherited = is_pandas and not module.startswith("bigframes.pandas.typing.api") %} + +{% if is_pandas %} .. autoclass:: {{ objname }} :no-members: - {% block methods %} - {% block attributes %} {% if attributes %} .. rubric:: {{ _('Attributes') }} @@ -14,18 +16,27 @@ .. autosummary:: :toctree: {% for item in attributes %} + {%- if not skip_inherited or not item in inherited_members%} ~{{ name }}.{{ item }} + {%- endif %} {%- endfor %} {% endif %} {% endblock %} + {% block methods %} {% if methods %} .. rubric:: {{ _('Methods') }} .. autosummary:: :toctree: + {% for item in methods %} + {%- if not skip_inherited or not item in inherited_members%} ~{{ name }}.{{ item }} + {%- endif %} {%- endfor %} {% endif %} {% endblock %} +{% else %} +.. autoclass:: {{ objname }} +{% endif %}