Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
97b4ca5
Test commit.
jakeichikawasalesforce Nov 21, 2024
1a7c028
Test integ.
jakeichikawasalesforce Nov 21, 2024
17dec72
Test deleting stage path.
jakeichikawasalesforce Nov 21, 2024
b74ecc4
Add docstring updates.
jakeichikawasalesforce Nov 21, 2024
16e1f25
Test modified docstring.
jakeichikawasalesforce Nov 21, 2024
3dbbd83
Test docstring update.
jakeichikawasalesforce Nov 21, 2024
72be566
docstring test.
jakeichikawasalesforce Nov 21, 2024
a351438
return docstring escaped.
jakeichikawasalesforce Nov 21, 2024
ef066ac
docstring str
jakeichikawasalesforce Nov 21, 2024
6696388
try except around docstring.
jakeichikawasalesforce Nov 21, 2024
cef04d7
return utf-8
jakeichikawasalesforce Nov 21, 2024
be38d88
win32 encoding.
jakeichikawasalesforce Nov 21, 2024
dc668a2
Fix for win32.
jakeichikawasalesforce Nov 21, 2024
d54a68a
change condition order.
jakeichikawasalesforce Nov 21, 2024
44f3dfa
undo endpoint_handler change.
jakeichikawasalesforce Nov 21, 2024
ec05b7e
change docstring impl
jakeichikawasalesforce Nov 21, 2024
a0ca62b
test get_doc_string.
jakeichikawasalesforce Nov 21, 2024
4ed2768
test get_doc_string.
jakeichikawasalesforce Nov 21, 2024
d7d264f
fix doc string.
jakeichikawasalesforce Nov 21, 2024
6cd77b2
clean up get_doc_string.
jakeichikawasalesforce Nov 21, 2024
5231e4f
try skipping docstring on 32bit only.
jakeichikawasalesforce Nov 21, 2024
0b2ed8e
use sys instead of platform.
jakeichikawasalesforce Nov 21, 2024
189fd5b
print error
jakeichikawasalesforce Nov 21, 2024
464a5f0
print pytest logs.
jakeichikawasalesforce Nov 21, 2024
2cc16e3
try -s
jakeichikawasalesforce Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:

- name: Test with pytest
run: |
pytest tests
pytest -s tests

2 changes: 2 additions & 0 deletions tabpy/tabpy_tools/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import copy
import inspect
from re import compile
import time
import requests
Expand Down Expand Up @@ -390,6 +391,7 @@ def _gen_endpoint(self, name, obj, description, version=1, schema=None, is_publi
"methods": endpoint_object.get_methods(),
"required_files": [],
"required_packages": [],
"docstring": endpoint_object.get_doc_string(),
"schema": copy.copy(schema),
"is_public": is_public,
}
Expand Down
16 changes: 12 additions & 4 deletions tabpy/tabpy_tools/custom_query_object.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sys
from .query_object import QueryObject as _QueryObject


Expand Down Expand Up @@ -71,10 +72,17 @@ def query(self, *args, **kwargs):

def get_doc_string(self):
"""Get doc string from customized query"""
if self.custom_query.__doc__ is not None:
return self.custom_query.__doc__
else:
return "-- no docstring found in query function --"
default_docstring = "-- no docstring found in query function --"

# TODO: fix docstring parsing on Windows systems
# if sys.platform == 'win32':
# return default_docstring
try:
ds = getattr(self.custom_query, '__doc__', None)
return ds if ds and isinstance(ds, str) else default_docstring
except Exception as e:
print(e)
return default_docstring

def get_methods(self):
return [self.get_query_method()]
Expand Down
2 changes: 2 additions & 0 deletions tabpy/tabpy_tools/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Endpoint(RESTObject):
version = RESTProperty(int)
description = RESTProperty(str)
dependencies = RESTProperty(list)
docstring = RESTProperty(str)
methods = RESTProperty(list)
creation_time = RESTProperty(datetime, from_epoch, to_epoch)
last_modified_time = RESTProperty(datetime, from_epoch, to_epoch)
Expand All @@ -64,6 +65,7 @@ def __eq__(self, other):
and self.version == other.version
and self.description == other.description
and self.dependencies == other.dependencies
and self.docstring == other.docstring
and self.methods == other.methods
and self.evaluator == other.evaluator
and self.schema_version == other.schema_version
Expand Down
Loading