You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to create a custom IOManager to send/load a path to a S3 storage. I want my asset return a local path and get a local path. IOManager will load the local path to the S3 storage. To create a URI endpoint, I need to extract the filename in handle_output and get back the filename from load_input.
I tried this :
@assetdefasset1() ->Path:
returnPath("tmp/test.png")
defasset2(asset1: Path) :
print(asset1)
classMyIoManager:
defhandle_output(self, context, path: Path):
filename=os.path.basename(path)
context.add_input_metadata({"filename", filename)
defload_input(self, context) ->Path:
metadata=context.upstream_output.metadataassert"filename"isinmetadata#DOESNT WORK . How to access filename ??
I tried to exchange data between handle_output and load_input using metadata. But it doesn't work. context.upstream_output.metdata only returns data set from @asset decorator.
How to exchange data between handle_output and load_input ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I try to create a custom IOManager to send/load a path to a S3 storage. I want my asset return a local path and get a local path. IOManager will load the local path to the S3 storage. To create a URI endpoint, I need to extract the filename in handle_output and get back the filename from load_input.
I tried this :
I tried to exchange data between handle_output and load_input using metadata. But it doesn't work. context.upstream_output.metdata only returns data set from @asset decorator.
How to exchange data between handle_output and load_input ?
Beta Was this translation helpful? Give feedback.
All reactions