stephenholzman / tidyusafec

An R wrapper for the OpenFEC API that features tidy cleaning.
https://stephenholzman.github.io/tidyusafec/
Other
7 stars 0 forks source link

error when unnest_committees = TRUE #29

Open ylelkes opened 4 years ago

ylelkes commented 4 years ago

I get the following when I run:

senate16 <- search_candidates(election_year = "2018",
                              office = "S", 
                              unnest_committees = TRUE)
x Result 427 must be a single string, not NULL of length 0
ℹ Input `treasurer_name` is `map_chr(principal_committees, function(x) x$treasurer_name)`.
Run `rlang::last_error()` to see where the error occurred.

thanks!

stephenholzman commented 4 years ago

Thanks for flagging, have some other tasks at hand but will be able to investigate next week!

stephenholzman commented 4 years ago

There's a weird thing happening with that particular candidate and a NULL value that I haven't seen elsewhere. I've implemented a hacky solution for now in this last commit so that it doesn't breakdown, but instead returns the string "NULL" for treasurer_name where for other committees it normally returns the empty string "": https://github.com/stephenholzman/tidyusafec/commit/d334a2e54b7a8b487116be2ffafe4a25e1574554