-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Feature] document a materialization #9841
Comments
Thanks for opening this @salimmoulouel ! Good news: there's already a way you can do this by documenting a macro. It also works in conjunction with docs blocks so you don't have to repeat yourself. The key insight is that for each of your custom materializations, dbt creates a macro in the following format:
See below for an example you can try out. Since we already have the capability to document materializations, I'm going to close this as not planned. But any feedback on this capability is welcome. Example
{% materialization my_materialization_name, default %}
-- the logic for your custom materialization is in here
{% endmaterialization %}
{% materialization my_materialization_name, adapter='xyz' %}
-- if you need custom logic for the xyz adapter, then it is in here
{% endmaterialization %}
version: 2
# Format of macros for materializations:
# materialization_{materialization_name}_{adapter}
macros:
- name: materialization_my_materialization_name_default
description: '{{ doc("my_materialization") }}'
- name: materialization_my_materialization_name_xyz
description: '{{ doc("my_materialization") }}' Generate your docs and launch the website: dbt docs generate
dbt docs serve Navigate the to the macros folder and click on one of the macros for your materialization: |
[Preview](https://docs-getdbt-com-git-dbeatty10-patch-1-dbt-labs.vercel.app/faqs/Docs/documenting-macros#document-a-custom-materialization) ## What are you changing in this pull request and why? dbt-labs/dbt-core#9841 asked about documenting custom materializations, and this PR explains how to document the macro(s) associated with each custom materialization. ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] I tested that the code example works
Is this your first time submitting a feature request?
Describe the feature
i want to be able to document a materialization in a yaml file
ex :
when i execute
dbt docs generate
anddbt docs serve
i want to see my materialization documentedDescribe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: