New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use latest config in S3Path's unless passed explicitly #175
use latest config in S3Path's unless passed explicitly #175
Conversation
bors try |
tryBuild failed: |
bors try |
No tests failed, which is a bit encouraging that it's not breaking. Basically, the case that will fail is: global_aws_config(; arguments_1...)
path = S3Path(bucket, key) # only valid with `arguments_1`
global_aws_config(; arguments_2...)
read(path) # works on master/release; fails on this PR because it picks up the new config On release/master, However, if you pass a config like config = global_aws_config(; arguments_1...)
path = S3Path(bucket, key; config) # only valid with `arguments_1`
global_aws_config(; arguments_2...)
read(path) # still works then it will "freeze" that config in like it does now. So it's only about the default when you don't pass a config explicitly. I think the current behavior is surprising/unintuitive; most users expect a "path" to just be a stateless indicator/pointer/etc to an asset, not something stateful that depends on when it was created. Therefore, I think there's a decent argument to be made that this is a bugfix and likely anyone who wanted to create their paths with a particular config (different from the global one they'd be using later) would already be passing a config explictly. However, given AWSS3 likely has a large set of users, I also wouldn't be that surprised if someone was relying on freezing the global config in a path and then changing the global config. If anyone has any thoughts about whether this should be a breaking release or not please share them. I think we shouldn't be too afraid to make breaking releases that improve the semantics, however, especially since we are pre-1.0 anyway, so I would be fine with just doing the breaking version bump here. |
bors try |
tryBuild failed: |
bors try |
In my opinion this should be a breaking change because the default behavior has changed. Had you left the defaults alone, it would be non-breaking. On second thought, it makes me a little nervous to change the default at all... it seems reasonable to expect |
There is no additional request; once the global config has been set once it is just deferencing a ref: https://github.com/JuliaCloud/AWS.jl/blob/76619b840682cea50c4069f89e2e36ee6f63b802/src/AWS.jl#L44-L62 |
Clearly I did not read this carefully enough. That sounds great, I suppose this is non-breaking then. Might be worth waiting for someone more lucid than I to chime in before merging. I'm not sure if this will break anything for anyone, but I suspect that if it does it will be in a subtle and infuriating way. |
Ok, I think breaking is a reasonable choice then. That will help make sure no one is caught off guard by this change, and those relying on the previous behavior will have the opportuntity to update (by passing in the config as e.g. changing To help justify why I think this change is still worth a breaking release: the current behavior can be pretty unexpected, and if you aren't in |
Hmm, I wonder if this would be better handled in AWS.jl with a |
Hm, interesting idea. Are there other objects that "bake in" the config like this? Most of what I've used AWS.jl for has been with @service CloudWatch_Logs
CloudWatch_Logs.describe_log_streams(log_group, params) which gets the latest config automatically (or you can pass one with The other concern I have with that idea is that I don't think it would work to support this kind of use-case: module MyModellingPackage
const MyDataSet = S3Path(bucket, key)
function __init__()
global_aws_config(; region="us-east-2")
return nothing
end
...fun modelling work...
end # module Here, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I agree with being able to decouple an S3Path
from a specific AWS configuration. One thought on this: is it useful to have an S3Path
with an embedded config? I think the dynamic behaviour allowed by nothing
here is probably what most people want. I suspect including the config
as field was done mainly as a convenience to avoid having to pass in a configuration when making a call such as stat(::S3Path)
.
This makes me think if we're making a breaking change anyway possibly we should remove the config
field from S3Path
and allow passing in an alternate config when one is actually used.
src/s3path.jl
Outdated
@@ -1,4 +1,4 @@ | |||
struct S3Path{A<:AbstractAWSConfig} <: AbstractPath | |||
struct S3Path{A<:Union{Nothing, AbstractAWSConfig}} <: AbstractPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be breaking but there may be some incompatibilities with packages that dispatch on S3Path{<:AbstractAWSConfig}
@omus Removing the |
I'm definitely not going to push on removing |
@ericphanson 0.8.8 is now out, so this can move forward. needs some conflict resolution to start. |
very exciting! if your schedule allows it please feel free to pick this up, otherwise I will try to get to it soon |
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
bors try |
Tests are passing. Not sure what else needs to be done for this, if anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last changes looks good to me, thanks @christopher-dG ! Not sure how we want to do merging for v0.9, there's a few breaking items on the milestone so it would be good to get them in together. Should we just call master v0.9 and start merging stuff in? (And not tag a release until the milestone is completed? We can of course still backport stuff on a branch if something comes up).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I would just merge the changes we want to be in v0.9 into master, bump the version, then tag a release. |
Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com>
bors r+ |
Closes #168
As an aside, I think this plus #161 will make S3Paths very ergonomic for reproducible usage, e.g.
Then, since it's hardcoded, bumping the dataset means making a new commit, so the code and data versions are always tied for reproducibility (assuming you commit a manifest of course).