Skip to content

return_type attribute for functions #17

Description

@FilippoTomelleri

Hello @jackscodemonkey,

I am using this (really cool) package to document some SQL scripts, but I get a strange error when I try to document an SQL function:
AttributeError: 'types.SimpleNamespace' object has no attribute 'return_type'

I had a look in the source code and it seems like the package gives for granted that there should be a return_type attribute when working with SQL functions.

if core_text.type == "FUNCTION": 
     section += n.line(
           "RETURNS: {}".format(core_text.comments.return_type),
           "RETURNS: {}".format(core_text.comments.return_type),
     )

Adding a check like hasattr(core_text.comments, "return_type") in the if clause seems to work.
If you think that I am doing something wrong in my documentation comment, please let me know, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions