-
Notifications
You must be signed in to change notification settings - Fork 924
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
Importing kedro.runners
enables Rich logging
#3985
Comments
I've done some digging and the issue at first seems to come from the import: [07/05/24 14:50:03] INFO Using [__init__.py](file:///Users/Merel_Theisen/anaconda3/envs/kedro/lib/python3.11/site-packages/kedro/framework/project/__init__.py):[246](file:///Users/Merel_Theisen/anaconda3/envs/kedro/lib/python3.11/site-packages/kedro/framework/project/__init__.py#246)
'/Users/Merel_Theisen/anaconda3/envs/kedro/lib/python3.11/site-package
s/kedro/framework/project/rich_logging.yml' as logging configuration. So it seems that logging is configured when you import the runner. I've also checked that this doesn't happen when importing e.g. It seems that this comes from the It looks like it comes from: kedro/kedro/runner/parallel_runner.py Lines 19 to 24 in a179f87
Which flows into: kedro/kedro/framework/hooks/specs.py Line 9 in a179f87
to: kedro/kedro/framework/context/context.py Line 16 in a179f87
which seems to lead to: kedro/kedro/framework/project/__init__.py Line 266 in a179f87
So it turns out it is both the import to |
Fixing this issue is very difficult, the code is quite nested, and we prefer to wait until we tackle the root cause of the issues we have with rich, see #3967 (comment) I'm leaving this open for visibility but we aren't doing anything about it for now. If somebody finds an easy way to fix it, PRs welcome. |
Description
Context
Steps to Reproduce
logging.warning("ANY MESSAGE")
on a notebook to see that it's formatted as plain textimport kedro.runners
logging.warning("ANY MESSAGE")
and observe the formatting has changedExpected Result
Actual Result
I didn't expect imports to have such side effects.
Also, I don't think there's a way to revert it: Textualize/rich#2461 so I need to resort to hacks.
The text was updated successfully, but these errors were encountered: