https://dagster.io/ logo
Title
l

Laura Moraes

05/11/2021, 3:40 PM
Hello! I'm trying to use IOManager to save files into folders. Is there anyway I could send some dynamic filename into IOManager? They are only defined at runtime (for example, the filename should be the result of some calculation), so I can't define it in the pipeline resources.
s

sandy

05/11/2021, 4:00 PM
Hi @Laura Moraes - the only information that's shared by
handle_output
and
load_input
is the information inside the
OutputContext
. So you have a couple options: • Run the same calculation inside both
handle_output
and
load_input
to determine the file path. • Store the calculated file path in some location that both
handle_output
and
load_input
know about. For that, you could do something like wrap the
PickledObjectS3IOManager
to store the file path.
As I mentioned on the other thread, happy to chat on Zoom to help think through this. I'm free on Thursday between 9 am and noon pacific if there's a good time there for you
l

Laura Moraes

05/11/2021, 4:05 PM
I'm adding @João Luiz Carabetta to this chat
j

Jeff Hulbert

05/11/2021, 4:06 PM
I have some custom IO managers I wrote that do similar to what @sandy described - will post to github when I get a chance. The part I wanted to be able to do but haven't yet is to timestamp the filename but because the config is recalculated on each run that doesn't work if a pipeline is partially rerun.
l

Laura Moraes

05/12/2021, 1:47 PM
Hi @sandy, could we talk on Thursday at 9am, pacific time? We were reading the Output documentation, and would like to understand if we could attach these data to the metadata (https://docs.dagster.io/_apidocs/solids#dagster.Output) to pass this information to the IO Manager.
s

sandy

05/12/2021, 3:02 PM
9 am on thursday works. If you DM me your email, I can send you a calendar invite with a zoom link
The metadata on the Output currently does not become available on the IOManager
a

Alex Kerney

06/10/2021, 2:22 PM
I was exploring how to get Output metadata in an IO Manager this morning, that would explain why I couldn’t find it. It would be great to be able to access to output metadata, as the information that you may want to encode in a path may not be known before execution.