Manuel Gomes
11/21/2021, 5:40 PMValueError: Filename must be a string
So there is clearly some sort of.. unwrapping/unpacking that I'm missing?
my flow is likewise in the thread, as is the invocation.
So... would someone please tell me in which exact angle I should smack my forehead and the correct octave of the "duh!"... plus maybe what I should be doing instead?Jenny
11/21/2021, 6:05 PMJenny
11/21/2021, 6:06 PMManuel Gomes
11/21/2021, 6:08 PMclass UploadTask(Task):
def run(self, video):
tgt = uuid.uuid1().__str__()
print("Video=%s" % video)
s3 = boto3.resource('s3')
result = s3.Bucket('MAH_BUCKET').upload_file(
video,
tgt
)
pprint(result)
return(result)
with Flow("Process video") as flow:
uploader = UploadTask()
video = Parameter('video')
result = uploader.run(video)
Manuel Gomes
11/21/2021, 6:08 PMv = Parameter("video", "/abs/path/to/my.mp4")
flow.run(parameters=dict(video=v))
Manuel Gomes
11/21/2021, 6:09 PMJenny
11/21/2021, 6:11 PMManuel Gomes
11/21/2021, 6:13 PMJenny
11/21/2021, 6:14 PMJenny
11/21/2021, 6:15 PMKevin Kho
with Flow("Process video") as flow:
uploader = UploadTask()
video = Parameter('video')
result = uploader.run(video)
should be
with Flow("Process video") as flow:
uploader = UploadTask()
video = Parameter('video')
result = uploader(video)
and I think that will work. You can also init the UploadTask
outside the flow.
uploader = UploadTask()
with Flow("Process video") as flow:
video = Parameter('video')
result = uploader(video)
You shouldn’t have to call run
on the task because the flow block will do it for you.