Skip to content

Commit

Permalink
Fix get_doc_string.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeichikawasalesforce committed Nov 21, 2024
1 parent bebeab0 commit 091847e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tabpy/tabpy_tools/custom_query_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ def query(self, *args, **kwargs):
def get_doc_string(self):
"""Get doc string from customized query"""
default_docstring = "-- no docstring found in query function --"
if platform.system() == "Windows" and sys.maxsize <= 2**32:

# TODO: fix docstring parsing on Windows systems
if sys.platform == 'win32':
return default_docstring
else:
return inspect.getdoc(self.custom_query) or default_docstring

ds = getattr(self.custom_query, '__doc__', None)
return ds if ds and isinstance(ds, str) else default_docstring

def get_methods(self):
return [self.get_query_method()]
Expand Down

0 comments on commit 091847e

Please sign in to comment.