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
A few steps to unpack here... fastexcel uses the standard Rust log crate, which provides the warn!() macro. It also uses the pyo3-log crate, which redirects Rust log calls to Python logging. That means, it's as if it was implemented in Python and called logging.warning() to emit that message. And just like in Python, these warnings are not related to the warnings emitted and filtered with the warnings module.
An application using libraries that emit logging warnings can call logging.basicConfig (or another config function) at initialization time to generally influence if and where log messages are emitted. Your workaround also works, but it isn't the only way to silence those.
There isn't a bug in PyO3 here - if fastexcel wanted to emit warnings via the warnings module, they should use PyErr::warn instead of log::warn.
However, that API is pretty cumbersome to use, requiring a CStr among others, so I'd say that there is room for improvement, maybe with a py_warn! macro, and we can keep this issue open (with a better title) until that is implemented.
fastexcel uses this warn macro here
Over on the python side I want to suppress that through
but the warning persists. It seems that warnings from rust ought to be caught with the warnings module too.
I was able to do this as a workaround
The text was updated successfully, but these errors were encountered: