5555 "sphinx.ext.napoleon" ,
5656 "myst_parser" ,
5757 "IPython.sphinxext.ipython_directive" ,
58+ "autoapi.extension" ,
5859]
5960
6061source_suffix = {
8081
8182autosummary_generate = True
8283
84+ autoapi_dirs = ["../../python" ]
85+ autoapi_ignore = ["*tests*" ]
86+ autoapi_member_order = "groupwise"
87+ suppress_warnings = ["autoapi.python_import_resolution" ]
88+ autoapi_keep_files = True
89+ autoapi_python_class_content = "both"
8390
84- def autodoc_skip_member (app , what , name , obj , skip , options ):
85- exclude_functions = "__init__"
86- exclude_classes = ("Expr" , "DataFrame" )
8791
88- class_name = ""
89- if hasattr (obj , "__qualname__" ):
90- if obj .__qualname__ is not None :
91- class_name = obj .__qualname__ .split ("." )[0 ]
92+ def autoapi_skip_member_fn (app , what , name , obj , skip , options ):
93+ skip_contents = [
94+ # Re-exports
95+ ("class" , "datafusion.DataFrame" ),
96+ ("class" , "datafusion.SessionContext" ),
97+ ("module" , "datafusion.common" ),
98+ # Deprecated
99+ ("class" , "datafusion.substrait.serde" ),
100+ ("class" , "datafusion.substrait.plan" ),
101+ ("class" , "datafusion.substrait.producer" ),
102+ ("class" , "datafusion.substrait.consumer" ),
103+ ("method" , "datafusion.context.SessionContext.tables" ),
104+ ("method" , "datafusion.dataframe.DataFrame.unnest_column" ),
105+ ]
106+ if (what , name ) in skip_contents :
107+ skip = True
92108
93- should_exclude = name in exclude_functions and class_name in exclude_classes
109+ return skip
94110
95- return True if should_exclude else None
96111
97-
98- def setup (app ):
99- app .connect ("autodoc-skip-member" , autodoc_skip_member )
112+ def setup (sphinx ):
113+ sphinx .connect ("autoapi-skip-member" , autoapi_skip_member_fn )
100114
101115
102116# -- Options for HTML output -------------------------------------------------
@@ -106,9 +120,7 @@ def setup(app):
106120#
107121html_theme = "pydata_sphinx_theme"
108122
109- html_theme_options = {
110- "use_edit_page_button" : True ,
111- }
123+ html_theme_options = {"use_edit_page_button" : False , "show_toc_level" : 2 }
112124
113125html_context = {
114126 "github_user" : "apache" ,
0 commit comments