-
Notifications
You must be signed in to change notification settings - Fork 308
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
Handle importstring pre/post save hooks #754
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
Codecov Report
@@ Coverage Diff @@
## main #754 +/- ##
==========================================
- Coverage 70.68% 70.56% -0.12%
==========================================
Files 62 62
Lines 7620 7620
Branches 1218 1215 -3
==========================================
- Hits 5386 5377 -9
- Misses 1860 1864 +4
- Partials 374 379 +5
Continue to review full report at Codecov.
|
Thanks @dleen for opening this PR.
is being validated as a new hook, but is also treated as an already existing hook, which it isn't because otherwise it would have been validated and converted to a callable. if self.pre_save_hook is not None: with: if callable(self.pre_save_hook): |
Only treat a hook as a replacement if the existing hook is callable. Otherwise treat it as a new hook. Closes jupyter-server#753
Yep that solution makes more sense! |
Kicking CI |
Thanks! The minimum version check is being handled in #756 |
Try access the name attribute on the function form of the hook, and
if it doesn't exist then use the string as the name.
Closes #753