great-evening-65843
06/29/2023, 9:51 PMFlyteFile
, but the output of the function which it's decorating. For example:
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
However, it seems that when I use it in this way, the file does not get uploaded to the remote_path
specified. I'm not very clear about how the internals of FlyteFile
works, but I was wondering if the file will only be uploaded if the FlyteFile
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!magnificent-teacher-86590
06/29/2023, 9:54 PMthankful-minister-83577
<http://TypeEngine.to|TypeEngine.to>_literal
on the instance that will suffice.thankful-minister-83577
great-evening-65843
06/29/2023, 10:46 PMgreat-evening-65843
06/30/2023, 4:53 PMthankful-minister-83577
thankful-minister-83577
thankful-minister-83577
thankful-minister-83577