-
Notifications
You must be signed in to change notification settings - Fork 1
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
Partial PEP updates #59
Comments
Ideally, we should have partial updates of all the value in the column. So for the structure that we have right now, we can't change columns e.g. annotation. Some useful information: In this case my proposition is to move keys: About changing the PEPs, I think we should do it using complete peppy object p.s. partial pep updates is ready, but I think it is really a bad idea to change json values separately. |
I don't think there's any problem to update JSON values separately. Can you explain why you are reluctant? |
Would it be easier to supply and API that is more something like this: values_to_update = {
"description": "This is a new PEP.",
"is_private": False,
"sample_table": "sample_name,file\nfrog1,frog1.txt\nfrog2,frog2.txt"
}
for key, value in values_to_update.items():
pepdbagent.update_project("nleroy917/basic:default", key, value) There needs to be some logic as to whether or not the key-value pairs belong to the project or the annotation... that can be tricky I understand its not just a simple update statement. |
About project dict, it's fine that all the values (config, sample, subsample) are in one place, because it's one project. But if we are talking about annotation, e.g. last_update, It's better to create new column. I found information that: "From a performance perspective, it hardly matters whether you change a single piece of data inside a JSON object or all of it: a new version of the row has to be written." Additionally, if we want to update json, the SQL is more complicated, especially if we want to update few columns, or few values from one column.
Ok, we also can send separate requests to update every key individually. But in that case, it will be inefficient. p.s. I already wrote function to update values partially, but there is still some errors...:
pepdbagent/pepdbagent/pepdbagent.py Lines 307 to 406 in 6658ad4
|
@khoroshevskyi this is great, and I can integrate this with pephub as it is. Wondering if there is another method for updating things like |
In v0.7.0 I added sample update/add/delete functionality. So this is partial solution for this issue |
To support the
PATCH
requests and partial updating of PEPs on pephub, it would be convenient to have a.update_pep()
function. I can also just execute raw SQL if needed.The text was updated successfully, but these errors were encountered: