You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a flag to suppress {{ print(msg) }} messages coming out of macros. Docs for print to be added here.
print functionality in macros was added in as part of #3451 but there is currently no way to keep the messages from being printed to stdout. This can result in these messages interspersed with logs going to stdout.
The change will involve adding a flag to flags.py and main.py called --no-print. Copying the way quiet was implemented will get you where you need to go.
Logic also needs to be added to stop printing to stdout. This can be accomplished by wrapping the print command with an if statement for when the --no-print flag is false.
Once this is all done, docs.dbt.com will also need top be updated. Specifically, this page. Open an issue over in that repo for that piece of this.
Describe alternatives you've considered
Not doing this simply means that {{ print(msg) }} will always print to stdout.
Who will this benefit?
Right now, anything sent to stdout using {{ print(msg) }} will get printed to stdout all the time with no way to suppress it. This will allow anyone using macros utilizing print to suppress those messages.
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Is there an existing feature request for this?
Describe the Feature
Add a flag to suppress
{{ print(msg) }}
messages coming out of macros. Docs forprint
to be added here.print
functionality in macros was added in as part of #3451 but there is currently no way to keep the messages from being printed to stdout. This can result in these messages interspersed with logs going to stdout.The change will involve adding a flag to
flags.py
andmain.py
called--no-print
. Copying the wayquiet
was implemented will get you where you need to go.Logic also needs to be added to stop printing to stdout. This can be accomplished by wrapping the
print
command with an if statement for when the--no-print
flag is false.dbt-core/core/dbt/context/base.py
Lines 576 to 588 in 41c6177
Once this is all done,
docs.dbt.com
will also need top be updated. Specifically, this page. Open an issue over in that repo for that piece of this.Describe alternatives you've considered
Not doing this simply means that
{{ print(msg) }}
will alwaysprint
to stdout.Who will this benefit?
Right now, anything sent to stdout using
{{ print(msg) }}
will get printed to stdout all the time with no way to suppress it. This will allow anyone using macros utilizingprint
to suppress those messages.Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: