@@ -95,20 +95,20 @@ def construct(
95
95
non_lazy_keys = frozenset (non_lazy_vals )
96
96
hash_cache = Cache () # share the hash cache to avoid recalculations
97
97
non_lazy_hash = hash_function (non_lazy_vals , cache = hash_cache )
98
- defn_hash = hash_function (type (task ), cache = hash_cache )
98
+ task_hash = hash_function (type (task ), cache = hash_cache )
99
99
# Check for same non-lazy inputs
100
100
try :
101
- defn_cache = cls ._constructed_cache [defn_hash ]
101
+ cached_tasks = cls ._constructed_cache [task_hash ]
102
102
except KeyError :
103
103
pass
104
104
else :
105
105
if (
106
- non_lazy_keys in defn_cache
107
- and non_lazy_hash in defn_cache [non_lazy_keys ]
106
+ non_lazy_keys in cached_tasks
107
+ and non_lazy_hash in cached_tasks [non_lazy_keys ]
108
108
):
109
- return defn_cache [non_lazy_keys ][non_lazy_hash ]
109
+ return cached_tasks [non_lazy_keys ][non_lazy_hash ]
110
110
# Check for supersets of lazy inputs
111
- for key_set , key_set_cache in defn_cache .items ():
111
+ for key_set , key_set_cache in cached_tasks .items ():
112
112
if key_set .issubset (non_lazy_keys ):
113
113
subset_vals = {
114
114
k : v for k , v in non_lazy_vals .items () if k in key_set
@@ -193,7 +193,7 @@ def construct(
193
193
f"constructor of { workflow !r} "
194
194
)
195
195
if not dont_cache :
196
- cls ._constructed_cache [defn_hash ][non_lazy_keys ][non_lazy_hash ] = workflow
196
+ cls ._constructed_cache [task_hash ][non_lazy_keys ][non_lazy_hash ] = workflow
197
197
198
198
return workflow
199
199
0 commit comments