-
Notifications
You must be signed in to change notification settings - Fork 65
Port AWSCredentials from AWSCore #122
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
Conversation
I believe LazyJSON was used for performance reasons. It would be good to do some benchmarking. |
Below is a benchmark comparison between Time Comparison:
I'll create a new commit moving from using JSON
using LazyJSON
path = joinpath(@__DIR__, "metadata.json")
function _lazyjson()
file = String(read(path))
LazyJSON.parse(file)
end
function _json()
JSON.parsefile(path)
end
@time _lazyjson()
@time _json() |
|
I spent the last little while trying to convert from using
|
| end | ||
|
|
||
| info = get(info, "Errors", info) | ||
| info = get(info, "Error", info) |
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.
This code is a little bizarre. Right now all of these would unpack in the same way:
info = Dict("Errors" => 1, "Error", => 2)
info = Dict("Errors" => Dict("Error", => 2))
info = Dict("Error", => 2)What is the structure you want to unpack?
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.
This is just ported over from AWSCore.jl, to me it looks like AWS is returning either one or multiple errors in their response and this is just handling both of those cases.
I'll play around with this more but I believe that AWS will only return back Errors or Error but not both. I'll write some more tests to capture all these different cases.
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.
I updated this to have an XML and JSON request testing, I've spent some time looking around but I can't seem to find any examples online of other request errors that AWS throws back and their structures.
I'm a bit wary of updating this since it is working currently in AWSCore.jl and no one has logged an issue about it. Seems like this knowledge has been lost a bit. :(
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.
Ok, I guess leave it as is for now then
Co-Authored-By: Curtis Vogt <[email protected]>
Co-Authored-By: Curtis Vogt <[email protected]>
Co-Authored-By: Curtis Vogt <[email protected]>
nicoleepp
left a comment
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
omus
left a comment
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.
I'm good to proceed with this
Overview
This merge request is for the port of
AWSCredentialsas part of the re-write. I'm currently happy with the state that this component is in so it is almost a 1 to 1 mapping. There are a couple of changes however;LazyJSONin favour ofJSON. I don't see a point in using multiple JSON packages, so I removedLazyJSON.AWSCoreat this stage we run into naming conflicts forAWSCredentials. You can see the qualifiers here and through thetest/AWSCredentials.jlpackage, I have left reminders to remove the qualification afterwards.AWSCore.aws_config()to create the configuration object, it usesAWSCore.AWSCredentialsobject, there are cases which this breaks tests such as here. I have marked these tests as@test_broken, and left a comment above. The alternative would be to take these credential objects, and re-created them under theAWSmodule. But since the next merge request will be for creatingAWSConfig, I figured it's quicker just to do it this way.Next Steps
The next merge request will be to create the
AWSConfigobject, being based off of this proposal by Alex.