vandonr-amz commented on PR #30704: URL: https://github.com/apache/airflow/pull/30704#issuecomment-1523937006
> lru_cache caches the value of function keyed by arguments of the function (the only condition is that the arguments must be hashable). So it does precisely what the extra (unneded) code does in this case.. ok, but where is that value cached ? If the annotated method is global, the cache is global I suppose ? If it's an class method, the cache is stored with the object instance ? Here we want to cache just within the scope of the function, so we could write an annotated method as a sub-method, but then we have to write it twice, in both locations where it's used ? We can certainly do that, but I suggested extracting the duplicated code to a function in the first place to avoid this ^^ Or maybe there is a third way I'm missing ? With an lru_cache that is not duplicated and that doesn't cache _too much_ ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
