Abhi Singh
09/26/2019, 7:06 AM@pipeline
def iris_ingestion_pipeline():
convert_csv_to_json(
download_csv_from_url_to_file()
)
Currently, I am deleting the csv file in my convert_csv_to_json
solid just to get it working. This is not ideal though because I am coupling transformation and IO logic.
One option I got working was having convert_csv_to_json
return the file to be deleted which would then get passed into a delete_file
solid like so:
@pipeline
def iris_ingestion_pipeline():
delete_file(
convert_csv_to_json(
download_csv_from_url_to_file()
)
)
This is also not ideal because the semantics of the convert_csv_to_json become brittle if you plan on reusing that solid in contexts where you don't want to delete the file
I then tried to go the tempfile route, but the issue here is that I have no way of persisting a tempfile_fp across solids unless I hack the execution context.
It is likely I am missing something obvious here with inputs but would love to get
A: Your opinions for how to do this? Just so I have a better intuition around how solids are to be composed
B: Opinions on support for tempfiles and tmpdir's?alex
09/26/2019, 3:07 PMalex
09/26/2019, 3:08 PMalex
09/26/2019, 3:12 PMcontext.resources.tempfile
Abhi Singh
09/26/2019, 3:21 PM