Skip to content
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

The order and structure that is returned when getting the export list from kobo_exports has been switched, leading to a series of problems in the functioning of this library. #23

Open
Falnesio opened this issue Nov 21, 2024 · 1 comment
Assignees

Comments

@Falnesio
Copy link

Falnesio commented Nov 21, 2024

The order that is returned when getting the export list has been switched so that the newest export appears first, leading to a series of problems in the functioning of this library. export_creator can no longer filter using post_export to obtain latest export. The structure of the list has also changed. This affects export_creator and what it returns because it changes what kobo_exports returns (which is something that may be troubling people that are using this library).

What once could be obtained from:

exportacoes <- kobo_exports(...)
uid <- exportacoes$results$uid
atualizacao <- exportacoes$results$date_created
dados <- exportacoes$results$result   
fonte <- exportacoes$results$data$source

Now needs to be obtained as such

exportacoes <- kobo_exports(...)
uid <- purrr::map_chr(exportacoes$results, ~ purrr::pluck(.x, "uid", .default = NA))
atualizacao <- purrr::map_chr(exportacoes$results, ~ purrr::pluck(.x, "date_created", .default = NA))
dados <- purrr::map_chr(exportacoes$results, ~ purrr::pluck(.x, "result", .default = NA))
fonte <- purrr::map(exportacoes$results, ~ .x$data$source %||% NA) %>% flatten_chr()
@Falnesio Falnesio changed the title The order adn structure that is returned when getting the export list from kobo_exports has been switched, leading to a series of problems in the functioning of this library. The order and structure that is returned when getting the export list from kobo_exports has been switched, leading to a series of problems in the functioning of this library. Nov 21, 2024
@asitav-sen
Copy link
Owner

Thanks @Falnesio . They keep on changing stuff. I will soon be updating the package to cater to these issues.

@asitav-sen asitav-sen self-assigned this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants