-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: globally disable progress bars #5207
Conversation
Pull Request Test Coverage Report for Build 5387621975
💛 - Coveralls |
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.
This implementation looks very nice and clean to me.
- Can you think of an easy way of testing it?
- I think it should be documented somewhere.
Tests added! I decided to test only if the |
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.
LGTM!
Related Issues
Proposed Changes:
SilenceableTqdm
, a class that wraps tqdm and automatically disables progress bars ifHAYSTACK_PROGRESS_BARS
is set to some falsey value (0
,False
,FALSE
,false
).from tqdm import tqdm
, as thefrom tqdm.auto import tqdm
was found really hard to intercept and wrap correctly.For @dfokina: to disable all Haystack progress bars, users can now set and environment variable called
HAYSTACK_PROGRESS_BARS
to one of0
,False
,FALSE
,false
. For example, in Bash (Linux) it's likeexport HAYSTACK_PROGRESS_BARS=0
. That's enough to disable all progress bars.How did you test it?
n/a
Notes for the reviewer
Should we test this class?
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.