Prevent logging at the kedro project level
See original GitHub issueI’m seeing a number of warnings of the type below but I can’t seem to figure out how to stop kedro from logging these to std console
/envs/kedro_test/lib/python3.7/site-packages/sklearn/linear_model/_least_angle.py:34: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
I thought the snippet below might work if I add it to the cli.py but it didnt’ do the job… What do I seem to be missing here?
import warnings
# Added because the numpy and sklearn versions class for np.bool type of checks, see below
warnings.filterwarnings("ignore", category=DeprecationWarning,
# module="numpy|sklearn|mlflow",
message="is a deprecated alias for the builtin")
Warning control on a specific function, module is pretty straightforward. However, this deprecation warning is completely taking over the log file so that we can’t see anything else.
Do you have suggestions where to place these warning filters?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Prevent logging at the kedro project level · Issue #737 - GitHub
I'm seeing a number of warnings of the type below but I can't seem to figure out how to stop kedro from logging...
Read more >Logging — Kedro 0.18.4 documentation - Read the Docs
The simplest way to do this is to delete your conf/base/logging.yml file. The logs directory can then also be safely removed. With no...
Read more >Silence Kedro Logs - Waylon Walker
Once we get the logger, we need to silence it by setting the log level. Typically it's not appropriate to completely turn off...
Read more >Working with Kedro: Setup - neptune.ai documentation
Setup and logging example# · Create a Kedro project from the pandas-iris starter. · Initialize the Kedro-Neptune plugin. · Add Neptune logging to...
Read more >Level Up Your MLOps Journey with Kedro | by Dylan Valerio
Starting a kedro project is easy. I've written several things in the code block below. Virtual environments are almost always necessary.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I seem to be having this same problem now with versions 0.18 and above, and the above solutions do not work. Any ideas on changes that need to be made?
Hi @roumail that’s a good point the new hook might be of help here. The new version should be out today.
Could you clarify where you’ve added? I’d expect if it’s in the
run()command, before creating theKedroSession, it would’ve still worked.Alternatively you might also look at configuring logging.captureWarnings and having a separate handler for that, but it might be a bit overkill.