amol- commented on a change in pull request #11830:
URL: https://github.com/apache/arrow/pull/11830#discussion_r761192082



##########
File path: docs/source/conf.py
##########
@@ -463,3 +464,40 @@ def setup(app):
     # This will also rebuild appropriately when the value changes.
     app.add_config_value('cuda_enabled', cuda_enabled, 'env')
     app.add_config_value('flight_enabled', flight_enabled, 'env')
+    app.add_directive('computefuncs', ComputeFunctionsTableDirective)
+
+
+class ComputeFunctionsTableDirective(Directive):
+    has_content = True
+    option_spec = {
+        "kind": directives.unchanged
+    }
+
+    def run(self):
+        from docutils.statemachine import ViewList
+        from docutils import nodes
+        import pyarrow._compute
+
+        result = ViewList()
+        function_kind = self.options.get('kind', None)
+
+        result.append(".. csv-table::", "<computefuncs>")
+        result.append("   :widths: 20, 60, 20", "<computefuncs>")
+        result.append("   ", "<computefuncs>")
+        funcs_reg = pyarrow._compute.function_registry()
+        for fname in funcs_reg.list_functions():
+            f = funcs_reg.get_function(fname)
+            option_class = ""
+            if f._doc.options_class:
+                option_class = ":class:`{}`".format(
+                    f._doc.options_class
+                )
+            if not function_kind or f.kind == function_kind:
+                result.append('   "{}", "{}", "{}"'.format(

Review comment:
       updated to use f-strings




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to