trino-python-client
trino-python-client copied to clipboard
Add `flush=True` to `ConsoleRedirectHandler` print statements
Describe the feature
When using the ConsoleRedirectHandler for OAuth flows, the printed authentication URL sometimes doesn't appear immediately in VS Code terminal outputs (particularly when called through extensions like dbt Power User). This occurs because:
- The current implementation doesn't force flush the output buffer (auth.py#L286)
- Some IDE/plugin terminal implementations buffer stdout differently than standalone terminals
Request to modify the print statement to:
print(f"Open the following URL in browser for the external authentication: {url}", flush=True)
Describe alternatives you've considered
Waiting for fixes in downstream tools (vscode-dbt-power-user#1629)
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
Thanks for the explanation. This makes sense (and it's unexpected that writes to stdout will get bufferred).
It looks like a simple change, are you willing to submit a PR @mcgr0g ?
I’ve created a PR for this issue. @hashhar , please review when you have time.
@hashhar Hi! Any update on this?