PrefectHQ / prefect-aws

Prefect integrations with AWS.
https://PrefectHQ.github.io/prefect-aws/
Apache License 2.0
84 stars 40 forks source link

Fix `S3Bucket.copy_object` target path resolution #385

Closed dominictarro closed 5 months ago

dominictarro commented 6 months ago

Closes #384

Uses other bucket's _resolve_path method when copying to another S3Bucket object. If to_bucket is a string, doesn't resolve. Copies to self when to_bucket is None.

Example

from prefect_aws import S3Bucket

source = S3Bucket(bucket_name="source-bucket")
target = S3Bucket(bucket_name="target-bucket", bucket_folder="subpath/")
source.copy_object("abc.txt", "copies/abc.txt", target)
# subpath/copies/abc.txt

Screenshots

Checklist

dominictarro commented 6 months ago

Unclear what's up with the error message. Did something break in main?

AttributeError: 'CallSpec2' object has no attribute 'funcargs'

zzstoatzz commented 6 months ago

hey @dominictarro - that's because we had an issue with pytest. that change is merged now and we should be back to normal here. thanks for catching!

dominictarro commented 6 months ago

I just noticed that the same issue is in the move methods, so don't merge yet. Going to revisit this when I have time.

dominictarro commented 6 months ago

This is ready for review.