Prasanth Kothuri
03/03/2022, 5:15 PM# upload to s3
write_to_s3 = S3Upload(
bucket=s3_bucket,
boto_kwargs=dict(
endpoint_url=os.getenv("s3_endpoint"),
aws_access_key_id=os.getenv("s3_access_key"),
aws_secret_access_key=os.getenv("s3_secret_key")
)
)
output = write_to_s3(results.to_csv(index=False), key=file_name)
write_to_s3(results.to_csv(index=False).encode(), key=file_name)
Kevin Kho
Anna Geller
from prefect import task
import awswrangler as wr
@task
def upload_df(df, path):
wr.s3.to_csv(df1, path, index=False)