Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe macro arguments in schema.yml files #2081

Closed
drewbanin opened this issue Jan 31, 2020 · 0 comments · Fixed by #2096
Closed

Describe macro arguments in schema.yml files #2081

drewbanin opened this issue Jan 31, 2020 · 0 comments · Fixed by #2096
Labels
dbt-docs [dbt feature] documentation site, powered by metadata artifacts enhancement New feature or request

Comments

@drewbanin
Copy link
Contributor

drewbanin commented Jan 31, 2020

Describe the feature

This PR #2068 adds support for a macros: block in the schema.yml spec. We should update the macros: spec to support the specification of macro arguments + types, along with descriptions for those args.

Example:

macros:
 - name: my_macro
    arguments:
      - name: arg_1
        type: string
        description: The first argument
      - name: arg_2
        type: int
        description: "{{ doc('macro_arg2_docs') }}"

The types here would be informational only and don't need be validated.

This might be kind of funky for macros that support varargs or kwargs, so i don't know that it's worthwhile to think about validating the arguments in this spec against the macro definition or anything. The use case here is to support effective documentation of these macros and, eventually, really cool editor integrations.

Describe alternatives you've considered

I guess you could just pop all of this info into the macro description. Like a javadocs?

@drewbanin drewbanin added enhancement New feature or request dbt-docs [dbt feature] documentation site, powered by metadata artifacts labels Jan 31, 2020
@drewbanin drewbanin added this to the Barbara Gittings milestone Jan 31, 2020
beckjake added a commit that referenced this issue Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt-docs [dbt feature] documentation site, powered by metadata artifacts enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant