Changes jupyter magic to create temporary files#855
Merged
Conversation
Contributor
elijahbenizzy
left a comment
There was a problem hiding this comment.
Move this to ad-hoc utils?
Contributor
|
By adding a guard clause, the already implemented The issue was in for name, value in inspect.getmembers(module):
# Check if the attribute is a module
if inspect.ismodule(value):
if value.__package__ is None:
logger.info(
f"Skipping hash for module {value.__name__} because it has no __package__ "
f"attribute or it is None. This happens with lazy loaders."
)
continue
# Check if the module is in the same top level package
if module.__package__:
if value.__package__ != module.__package__ and not value.__package__.startswith(
module.__package__
):
logger.debug(
f"Skipping hash for module {value.__name__} because it is in a different "
f"package {value.__package__} than {module.__package__}"
)
continue
# Recursively hash the sub-module
hash_object = _hash_module(value, hash_object, seen_modules)
# Return the hash object
return hash_objectAs far as I understand, this code logic is meant to reduce redundant checks by skipping versioning of members of the same module. Skipping checks affects what is included in the hash computation, but this raises the question:
Currently working on fixing the logic to log code. This should be available on |
7 tasks
Temporary files allow us to then hash the code properly for use with the Hamilton UI. This does not change any functionality. If the interpreter is shutdown gracefully then the temporary files are deleted cleanly.
This is a better place to live. Makes note that one function is deprecated.
f51cc4c to
714d9cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temporary files allow us to then hash the code properly for use with the Hamilton UI.
This does not change any functionality. If the interpreter is shutdown gracefully then the temporary files are deleted cleanly.
Changes
How I tested this
Notes
Checklist