-
Notifications
You must be signed in to change notification settings - Fork 179
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
[ADAP-1047] [CT-3420] [Bug] Snowflake SAML authentication flow doesn't fully respect --quiet
command
#847
Comments
--quiet
command--quiet
command
--quiet
command--quiet
command
Thanks for reporting this @joellabes ! Suppressing the auth related text like you expected seems perfectly in alignment with the documentation for Root cause and potential implementationThat text looks like it is coming from Since they are going to standard out, we'd need to do some fancy footwork in order to silence them. For example, we could use a context manager like the following whenever we know there's a library like this has import sys
import io
from contextlib import contextmanager
@contextmanager
def suppress_stdout():
original_stdout = sys.stdout
sys.stdout = io.StringIO()
try:
yield
finally:
sys.stdout = original_stdout
with suppress_stdout():
# snowflake.connector.auth_method_that_eventually_prints_to_standard_out() |
I'm inclined to open a ticket with them to not use print rather than twist our code around it. @joellabes what are the biggest impacts this behavior with the --quiet command could cause? |
The point of adding It also depends how long the company's policies allow the snowflake token to be stored - on subsequent runs, I don't get the same problem because I auth once and then stay authed for a while. |
I talked with the team about what should happen here- and this kind of stdout catching is something we'd like to add, but a better place for it would be in core's event system. I'm closing this ticket in favor of dbt-labs/dbt-core#9174. |
Is this a new bug in dbt-core?
Current Behavior
I was testing dbt-labs/dbt-codegen#86 and ran the following command locally:
I wound up with this in something.yml:
Expected Behavior
Not to have the two logs from the Snowflake auth flow included:
Steps To Reproduce
With dbt-labs/dbt-codegen#86 checked out:
Run dbt deps
Run
dbt --quiet run-operation generate_model_yaml --args '{"model_name": "first_model"}' > models/something.yml
Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: