NCEAS / rt

An interface to the Request Tracker API
https://nceas.github.io/rt/
Other
6 stars 4 forks source link

Error in rt_search(): "Duplicate identifiers for rows" #11

Closed amoeba closed 6 years ago

amoeba commented 6 years ago

I just ran

rt_search("Queue='arcticdata'")

and got

Error: Duplicate identifiers for rows (6069, 6073), (9563, 9566, 9567) 

Traceback indicates it's tidyr doing the complaining:

12.
stop(cnd) 
11.
abort(glue("Duplicate identifiers for rows {rows}")) 
10.
spread.data.frame(., colname, value) 
9.
tidyr::spread(., colname, value) 
8.
function_list[[i]](value) 
7.
freduce(value, `_function_list`) 
6.
`_fseq`(`_lhs`) 
5.
eval(quote(`_fseq`(`_lhs`)), env, env) 
4.
eval(quote(`_fseq`(`_lhs`)), env, env) 
3.
withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) 
2.
tibble::tibble(content = stringr::str_split(httr::content(req), 
    "\\n--\\n")[[1]]) %>% dplyr::mutate(content = stringr::str_split(content, 
    "\\n"), line = 1:n()) %>% tidyr::unnest() %>% dplyr::filter(content != 
    "") %>% tidyr::separate(content, c("colname", "value"), sep = ":",  ... at rt_search.R#54
1.
rt_search("Queue='arcticdata'")

Just posting this so one of us takes a look at some point.

isteves commented 6 years ago

It looks like part of the problem is CF.{Overview}, which includes content that span several lines. The current parsing method splits it in weird ways.

amoeba commented 6 years ago

Maybe we could look at how any other RT libs that are out there do this stuff to get some guidance on a good pattern. i.e. https://github.com/CZ-NIC/python-rt/blob/master/rt.py#L673

isteves commented 6 years ago

Closed with #13