Hi prefect community! We’ve created a flow which c...
# prefect-community
f
Hi prefect community! We’ve created a flow which creates and saves an excel workbook. We’re trying to upload that workbook into our S3 bucket and we’ve provided the necessary credentials. The problem is that the bucket fills up with
*.prefect_result
files instead of a workbook. How can we fix that? This is the code snippet:
Copy code
flow.result = S3Result(bucket=bucket)
We used to run Prefect API using
prefect local agent
and a
LocalResult()
and that had worked fine. Now we’re using
prefect docker agent
and docker storage, that’s why we need to be able to upload the file.
z
Hi Fina! I would recommend writing your workbook directly from your task rather than using the prefect task results as those will be serialized into this format.
marvin 1
🙏 1
You could also consider defining a custom serializer to write your data as workbooks: https://docs.prefect.io/api/latest/engine/serializers.html#serializer
🙏 1
f
@Zanie very helpful, thanks so much! I managed to create and save a dummy textfile (yay! 🎉) so saving the workbook shouldn’t be that hard anymore!
c
@Marvin archive “Best practice for writing workbook to S3 bucket using Prefect Results?”
🙌 1