Skip to content

Commit

Permalink
clean up get_doc_string.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeichikawasalesforce committed Nov 21, 2024
1 parent d7d264f commit 6cd77b2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tabpy/tabpy_tools/custom_query_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,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 --"
# Docstring parsing not working on Windows.

# Skip docstring parsing on Windows 32-bit systems
if platform.system() == "Windows":
return default_docstring
else:
obj = self.custom_query
return obj.__doc__.strip() or default_docstring if isinstance(obj.__doc__, str) else default_docstring

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

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

0 comments on commit 6cd77b2

Please sign in to comment.