-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
If you create a new item using item_upsert with the title in info rather than title, the value in info$title gets silently ignored.
After logging in:
# create a new item (works as expected)
test_item <- item_upsert(title="books.json")
# unexpected: the new item has the title "books.json" rather than "sbtools stuff".
item_upsert(test_item, title=NULL, info=list(title = "sbtools stuff"))
# This message was given: "title is NULL - re-using title from input SB item"
# But it's not clear from the message that/why info$title is getting ignored
Possible approaches to clarify/change this behavior:
- Make
item_upsertmore clearly restrictive: either noisily overridetitlewithinfo$titleifinfo$titleexists, or always throw an error iftitleis included ininfo. - Make
item_upsertmore flexible: allow for all sorts of item queries, rather than just queries bytitle. All sorts of queries are available through the ScienceBase API for UPSERT (https://my.usgs.gov/confluence/display/sciencebase/ScienceBase+Catalog+Item+REST+Services#ScienceBaseCatalogItemRESTServices-UPSERTRequests). Maybe thetitlearg could be replaced by aquery_listarg with the same definition asquery_listinquery_sb?
Metadata
Metadata
Assignees
Labels
No labels