Benjamin Chew06/29/2023, 9:51 PM
, but the output of the function which it's decorating. For example:
However, it seems that when I use it in this way, the file does not get uploaded to the
def my_decorator(fn): @wraps(fn) def _wrapper(*args, **kwargs): out = fn(*args, **kwargs) ... # process and save 'out' to some local file file_handler = FlyteFile(path=some_path, remote_path=remote_path) return out return _wrapper @task @my_decorator def some_func(value: int) -> int: return value * 2
specified. I'm not very clear about how the internals of
works, but I was wondering if the file will only be uploaded if the
were created and returned directly within the decorated function itself? Is there any other way that I could still get this to work within my decorator function instead? Thanks!
Jay Ganbat06/29/2023, 9:54 PM
on the instance that will suffice.
Benjamin Chew06/29/2023, 10:46 PM