-
Notifications
You must be signed in to change notification settings - Fork 895
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
Prevent logging at the kedro project level #737
Comments
Sorry the label is automatically added, this is less of a bug report but rather a request for information. I'm not sure where to go to and I've already been through the documentation for logging. The logging part is not so informative: PS, is this somewhere that hooks might help?? |
Using the following transformer Hook, I'm able to prevent the spurious messages polluting the logs..
However, my log is still polluted by these messages prior to the "catalog" creation. I'm at a loss as to how I can access the logging that is done prior to this. Any helpful pointers would be appreciated..
|
Hello again - I saw that 0.17.3 has added the hook https://github.com/quantumblacklabs/kedro/blob/develop/RELEASE.md#upcoming-release-0173 |
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 Alternatively you might also look at configuring logging.captureWarnings and having a separate handler for that, but it might be a bit overkill. |
Hi @lorenabalan , Good to hear that the new version will be out today! The snippet I used to silence some of the warnings is given below. Basically, I added a TransformerHook in class TransformerHooks:
@property
def _logger(self):
return logging.getLogger(self.__class__.__name__)
@hook_impl
def after_catalog_created(self, catalog: DataCatalog) -> None:
# Added because the numpy and sklearn versions clash for np.bool type of checks
warnings.simplefilter("ignore", category=DeprecationWarning) |
I meant where did you try in |
Oh sorry to misunderstand. We were adding it in the cli.py file for the project, adapting the click function run where we also have the kedro session created.
If I understand you well, perhaps we should have adapted the run.py file instead? Yes, feel free to close the issue! Since the latest version has a convenient way to do this now |
Ah that seemed right to me, that's where I would've put it as well. Anyway, glad the new version makes it even easier to enable this behaviour. I'll close this issue as resolved. |
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? |
@lorenabalan any ideas here, in versions later than 0.18 it is not possible to disable external warnings as proposed above |
Hi, in my case (im using kedro 0.18.7) worked putting
In |
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 these to std console
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?
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?
The text was updated successfully, but these errors were encountered: