-
Notifications
You must be signed in to change notification settings - Fork 4
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
New govcan_dl_resources() methods #10
Conversation
Some issue on window for a specific test, I'm investigating (kind of harder without a Windows machine though), |
I had a lot of trouble with windows, turn out part of the problem was with the virtual environment.... see actions/runner-images#712, the second solution solves this! |
@KevCaz To avoid all these |
Yep, that's what I ended up doing! |
This looks absolutely awesome. Will review this on Monday. |
@@ -20,7 +20,7 @@ print.ckan_package_stack <- function(x, ...) { | |||
} else { | |||
cat(" Packages: \n") | |||
cli::cat_line() | |||
purrr::map(x[1:dim(x)], print_ckan_package_custom) | |||
purrr::map(x[seq_len(dim(x))], print_ckan_package_custom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I always forget this is best practice to use seq_len
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thank you for the thorough testing and the much cleaner methods. I just asked for a clarification on a line.
Also, I agree about what you said for downloads and html files. |
Hi @VLucet ,
I took some time to rewrite
govcan_dl_resources()
, in a nutshell :ckan_package_stack
,ckan_package
,ckan_resource
,ckan_resource_stack
andcharacter
.ìd_as_filename
) to use resource id as file name, this was needed as sometimes different resources have the same names (...:):).tibble
) is returned to identify which files were downloaded (see example below indetails
) and to gather all URLs.Note that documents such as html or wms are not downloaded (and for the moment I honestly think it is for the best). Also, because of the difficulties with "session" in
ckan_fetch()
, I think it makes more sense to just store files locally, so I always usestore = "disk"
but this cam always be changed in a future release.Let me know what do you think but I think with a little more work on this, you will be closed to a nice first release to the CRAN.
I can (of course) give you a hand for the doc and to add more tests.