From 741bf171baf6f15c8262fe08d6deecdcb9bbfd82 Mon Sep 17 00:00:00 2001 From: Jake Ichikawa Date: Thu, 21 Nov 2024 09:19:40 -0800 Subject: [PATCH] Improve docstring retreival. --- tabpy/tabpy_tools/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tabpy/tabpy_tools/client.py b/tabpy/tabpy_tools/client.py index 8b959119..9bda2ac6 100644 --- a/tabpy/tabpy_tools/client.py +++ b/tabpy/tabpy_tools/client.py @@ -397,7 +397,6 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi description = obj.__doc__.strip() or "" if isinstance(obj.__doc__, str) else "" endpoint_object = CustomQueryObject(query=obj, description=description,) - docstring = inspect.getdoc(obj) or "-- no docstring found in query function --" return { "name": name, @@ -409,7 +408,7 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi "methods": endpoint_object.get_methods(), "required_files": [], "required_packages": [], - "docstring": docstring, + "docstring": endpoint_object.get_doc_string(), "schema": copy.copy(schema), "is_public": is_public, }