-
Notifications
You must be signed in to change notification settings - Fork 16
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
sbtools: modifying data #115
Comments
edit existing things
make/remove things
|
you know, this lesson might actually be the best place to introduce this lesson might benefit from a paragraph up top outlining the logic behind the if you start with make/remove things, the student can make some scratch items that they can safely edit in the following section. |
I ended up switching this a little bit before you commented. Checkout this commit: lindsayplatt@78d87d9 |
Realizing that I mention |
@lindsaycarr wrote (Alison made a couple of edits):
Agreed that example 1 is not as expected. If a new title matches an old title, the old item should be updated. I made an sbtools issue: DOI-USGS/sbtools#239 Example 2 seems like a mildly annoying constraint: because title was NULL, item_upsert looked to the title of the parent, but then info also has title such that the body of the POST request contains
and then I suppose sciencebase just ignores the second one. Possible fixes for this could be for For example 3, I think that the |
I assumed that |
Yeah, I don't think that assumption can be met. It searches based on |
So how is |
Isn't that what I just answered? It's different because it takes different arguments. It should also be different because it can modify an item, with those different arguments, if a single matching item already exists. But see sbtools issues 239 and 240. |
Oh sorry, thought you were answering how |
yeah, my bad, was just writing an apology/clarification |
Still - |
and because it has this fancier functionality, it takes different arguments than either |
@lindsaycarr , regarding your slack issue with trying to create three items at once, repeated here: new_folder <- item_create(title='bigitem')
add_mult <- items_create(parent_id = c(new_folder, new_folder, user_id()),
title = c("item 1", "item 2", "top-level item"))
## Error: If parent_id length > 1, it must be of same length as title and info making parent_id a list rather than a vector, or a simple vector of character IDs, should work: add_mult <- items_create(parent_id = list(new_folder, new_folder, user_id()),
title = c("item 1", "item 2", "top-level item"))
# OR
add_mult <- items_create(
parent_id = c(new_folder$id, new_folder$id, user_id()),
title = c("item 1", "item 2", "top-level item")) but in both cases, all three items get created under the first parent_id:
...so i guess that's a new sbtools issue for us: DOI-USGS/sbtools#242 |
Oh man, another issue 😬 What do you think we should do for these examples in the mean time? |
yeah, 😬 ! hmm...use a single, replicated |
Parent: sbtools: accessing cloud-based data
Adding/modifying data
9999-06-25
The text was updated successfully, but these errors were encountered: