-
Notifications
You must be signed in to change notification settings - Fork 157
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
Mbeliaev/update props #298
Mbeliaev/update props #298
Conversation
81f0842
to
fb29cba
Compare
I agree with #65 and like the solution! But I don't like the effort and code amount that is required to fix #293 For instance, I see the next problem - when someone will update properties like these: path.properties['my-prop-1'] = 'test'
path.properties['my-prop-2'] = 'test2'
path.properties['my-prop-and-more'] = 'test-value' It'll generate 3 requests in the row (or even 6 times, because We can instead return "ReadOnlyDict" instance when one gets For instance, django does not hit DB every times when you write a property and waits until |
@allburov if you have this calls single request |
+@OddBloke as a requestor I think it is reasonable trade-off for now to send request on each update. We can well document it and explain that dict.update() will be better for production |
Usually people look at documentation when they already have about 10 requests for 1 artifact and have 10 artifacts that they are changing (10*10=100 requests). The suggested implementation changes the current behavior - if one use it as "set per-property" it'll generate a lot of unnecessary requests. With
and props = artifact.properties
props['my-prop'] = 'value'
props.update() then? 3 lines, the same way "one has to known something about the library" My suggestion is - let's keep "update_properties" in one request and merge it. I'm not sure that we should fix #293 at all, it doesn't add a new functional, just a few lines shorter solution, but it WILL add more code in the library. But let's talk about it there #293, if you want to |
Hey, thanks for this change! I've tested, and it does address my specific use case. However, I also agree that this could be a surprising (and costly) change for existing consumers of the API. (I've also commented on #293, so we don't have the conversation happening in two places.) |
fb29cba
to
3380b09
Compare
@allburov |
fix #65