Hello, This may be something simple that I’m just ...
# prefect-server
h
Hello, This may be something simple that I’m just totally overlooking but trying to use the s3.s3Upload.run in my flow in the following way:
Copy code
with Flow("test") as flow:
    s3.S3Upload.run(data, credentials="AWS_CREDENTIALS", bucket='bucket_name', compression='gzip')

flow.run()
Data is json string. I keep on getting this error
AttributeError: 'str' object has no attribute 'bucket'
k
You shouldn’t call the
run()
method inside the Flow. I don’t know if this will help but try:
Copy code
with Flow(..) as flow:
    S3Upload(init_stuff_here)(run_stuff_here)
h
Hey do you mean like this:
Copy code
with Flow("test") as flow:
    s3.S3Upload(data, credentials="AWS_CREDENTIALS", bucket='bucket_name', compression='gzip')

flow.run()
k
no you need 2 parenthesis. either:
Copy code
s = S3Upload()
with Flow(..) as flow:
    s()
or:
Copy code
with Flow(..) as flow:
    S3Upload()()
h
cheers, that was it! Thank you 🙂
k
Nice!