-
Notifications
You must be signed in to change notification settings - Fork 34
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
Silence "converting a masked element to nan" warning #924
Conversation
Build succeeded and deployed at https://prism-924.surge.sh |
api/app/utils.py
Outdated
warning_recorded = False | ||
|
||
|
||
def custom_warning_handler(message, category, filename, lineno, file=None, line=None): |
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.
I don't know if it's an issue for you, but https://docs.python.org/3/library/warnings.html#warnings.showwarning write to a file which is sys.stderr by default.
We could call the default _showwarnmsg_impl
for messages we don't want to filter to be clother to existings behavior ?
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 is an intenal function and looks like it has different signature based on the pyhton version. I'll use a standard logger instead, wdyt?
Silence "converting a masked element to nan" logs warnings after the first occurrence to avoid spamming the logs