Skip to content

Commit b74ecc4

Browse files
Add docstring updates.
1 parent 17dec72 commit b74ecc4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tabpy/tabpy_tools/client.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import copy
2+
import inspect
23
from re import compile
34
import time
45
import requests
@@ -379,6 +380,7 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi
379380
description = obj.__doc__.strip() or "" if isinstance(obj.__doc__, str) else ""
380381

381382
endpoint_object = CustomQueryObject(query=obj, description=description,)
383+
docstring = inspect.getdoc(obj) or "-- no docstring found in query function --"
382384

383385
return {
384386
"name": name,
@@ -390,6 +392,7 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi
390392
"methods": endpoint_object.get_methods(),
391393
"required_files": [],
392394
"required_packages": [],
395+
"docstring": docstring,
393396
"schema": copy.copy(schema),
394397
"is_public": is_public,
395398
}

tabpy/tabpy_tools/rest_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Endpoint(RESTObject):
4141
version = RESTProperty(int)
4242
description = RESTProperty(str)
4343
dependencies = RESTProperty(list)
44+
docstring = RESTProperty(str)
4445
methods = RESTProperty(list)
4546
creation_time = RESTProperty(datetime, from_epoch, to_epoch)
4647
last_modified_time = RESTProperty(datetime, from_epoch, to_epoch)
@@ -64,6 +65,7 @@ def __eq__(self, other):
6465
and self.version == other.version
6566
and self.description == other.description
6667
and self.dependencies == other.dependencies
68+
and self.docstring == other.docstring
6769
and self.methods == other.methods
6870
and self.evaluator == other.evaluator
6971
and self.schema_version == other.schema_version

0 commit comments

Comments
 (0)