-
Notifications
You must be signed in to change notification settings - Fork 982
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
Update builtins.md #4050
Update builtins.md #4050
Conversation
adding 1.5+ and <=v1.5 versioning and macro explaining for ref maco
✅ Deploy Preview for docs-getdbt-com ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirnawong1 Thanks so much for spearheading this!
What do you think of some sort of callout that this whole builtins
business is a pretty "advanced" use case? Users should be aware that they will need to maintain/update these overrides as they upgrade into the future.
``` | ||
</VersionBlock> | ||
|
||
<VersionBlock lastVersion="1.5"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous examples actually did something different — either updating or excluding the database
component of the returned Relation
— whereas the example above is just the same as default built-in ref
.
return a
Relation
with the database name overridden todev
I think we should update the example above to do the same:
-- call builtins.ref based on provided positional arguments
{% set rel = None %}
{% if packagename is not none %}
{% set rel = return(builtins.ref(packagename, modelname, version=version)) %}
{% else %}
{% set rel = return(builtins.ref(modelname, version=version)) %}
{% endif %}
-- finally, override the database name with "dev"
{% set newrel = rel.replace_path(database="dev") %}
{% do return(newrel) %}
hey @jtcohen6 , thank you for this awesome feedback! I've made changes based on your suggestions - how does it look now? |
adding 1.5+ and <=v1.5 versioning and explains macro
Resolves #3802