Kledia
10/17/2024, 3:49 PMsuggest_privilege_tags.from_source(
source=storage,
entrypoint=entry_point,
).deploy(
name="on-demand",
work_pool_name="default",
job_variables={"env": {"EXTRA_PIP_PACKAGES": "prefect-aws"}},
infrastructure=infrastructure,
)
storage = S3Bucket.load("flow-code")
but I am getting an error like this: 'S3Bucket' object has no attribute 'set_base_path'
.I am using prefect 2.13.8Marvin
10/17/2024, 3:49 PM'S3Bucket' object has no attribute 'set_base_path'
is not directly addressed in GitHub issues, and the documentation does not show a set_base_path
method for S3Bucket
. This suggests that the method you're trying to use may not exist or is being accessed incorrectly.
Instead, you might be mistaking set_base_path
for functionality that should be handled differently when using Prefect with AWS S3 storage. To define the path for storing the flow, you should ensure you're using the correct attributes and methods for S3Bucket
.
For loading from an S3 bucket, the typical approach is shown below:
python
from prefect_aws.s3 import S3Bucket
# Assuming 'flow-code' is the name of the bucket
s3_bucket = S3Bucket.load("flow-code")
# Any further method calls to store or retrieve objects from your bucket
If you're trying something specific, like setting a path manually, ensure you adjust your code according to available methods within S3Bucket
.
Please refer to the Prefect 2.x S3 documentation for more detailed insights on configuring S3 storage in your flows. If the issue persists, ensure that your Prefect AWS block setup is correctly configured and supports the operations you intend to perform.