Skip to content

Commit ec05b7e

Browse files
change docstring impl
1 parent 44f3dfa commit ec05b7e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tabpy/tabpy_tools/client.py

+6-2
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,10 @@ 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+
384+
docstring = "-- no docstring found in query function --"
385+
if sys.platform != "win32":
386+
docstring = inspect.getdoc(obj) or "-- no docstring found in query function --"
382387

383388
return {
384389
"name": name,
@@ -390,7 +395,7 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi
390395
"methods": endpoint_object.get_methods(),
391396
"required_files": [],
392397
"required_packages": [],
393-
"docstring": endpoint_object.get_doc_string(),
398+
"docstring": docstring,
394399
"schema": copy.copy(schema),
395400
"is_public": is_public,
396401
}
@@ -420,7 +425,6 @@ def _wait_for_endpoint_deployment(
420425
logger.info(
421426
f"Waiting for endpoint {endpoint_name} to deploy to " f"version {version}"
422427
)
423-
time.sleep(interval)
424428
start = time.time()
425429
while True:
426430
ep_status = self.get_status()

tabpy/tabpy_tools/custom_query_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def query(self, *args, **kwargs):
7171

7272
def get_doc_string(self):
7373
"""Get doc string from customized query"""
74-
if sys.platform != "win32" and self.custom_query.__doc__ is not None:
74+
if self.custom_query.__doc__ is not None:
7575
return self.custom_query.__doc__
7676
else:
7777
return "-- no docstring found in query function --"

0 commit comments

Comments
 (0)