Arran
07/30/2021, 3:07 PMfiles = [1, 2, 3]
data = extract_data.map(files)
upload = upload.map(data)
I would like to transform the above code so that file 1 will be extracted and uploaded before moving on to file 2. I know i could wrap this functionality in to one function but i would prefer to keep them separateKevin Kho
Arran
07/30/2021, 3:43 PMArran
07/30/2021, 3:45 PMKevin Kho
upload
would then accept the location instead of the data. This way the data
won’t be held in memory.Kevin Kho
Arran
07/30/2021, 3:46 PMKevin Kho
Kevin Kho
@task
def abc(x):
res = Result()
res.write(x, location=...)
del x
gc.collect()
return res.location
@task
def abc2(location):
res = Result().read(location)
But you might not need the delete step. Some users find that passing the location instead helps enough already.Arran
07/30/2021, 3:50 PMArran
07/30/2021, 3:50 PMKevin Kho