Skip to content
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

add assert for DelayedBase in parse_python #264

Merged
merged 1 commit into from
May 16, 2022
Merged

Conversation

JackTemaki
Copy link
Contributor

A quick rescue operation for #245

Copy link
Contributor

@michelwi michelwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make conscious decisions which part of the code is run in the manager and may not access the values in Path/Variable objects and which part only runs in the worker and may resolve them.
And then we should start making use of check_is_worker also in the recipes.

And then we really should sort out the problem of get vs get_path and __str__ vs. __repr__

@@ -235,6 +236,10 @@ def __parse_python(self, code, name=None):
if isinstance(code, str):
return code
if isinstance(code, DelayedBase):
assert self.hash_full_python_code is False, (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this this is only necessary for tk.Variable. tk.Path should not change the hash over time.
So we could allow using Path objects for now.

On the other hand, we might want to change the representation of Path/Variable in the Manager and then it would break some hashes. So maybe disallowing all DelayedBase objects for now is a good idea.

Thinking of it.. tk.Path.get() in the hash will make the hash dependent of the full path.. :/

@JackTemaki JackTemaki merged commit ac59540 into main May 16, 2022
@JackTemaki JackTemaki deleted the nick_add_hash_assert branch October 26, 2022 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants