-
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
collect throws an error in a hub without any model output files #4
Comments
Thanks for the report @elray1 ! This is a result of a conscious prior decision to not error when connecting to an empty hub. Using This would likely be non-ideal to fix from within Note that one thing we could also do is rather than have a different function ( |
I like the idea of our own |
In the end, trying to handle this in a hubverse hub_path <- system.file("testhubs/empty", package = "hubUtils")
hub_con <- hubData::connect_hub(hub_path) |>
dplyr::filter(is.na(output_type_id)) |>
dplyr::collect()
#> Warning in hubData::connect_hub(hub_path): No files of file formats "csv", "parquet", and "arrow" found in model output
#> directory.
#> Error in UseMethod("filter"): no applicable method for 'filter' applied to an object of class "c('hub_connection', 'list')" Created on 2024-03-27 with reprex v2.0.2 But in both filtering and just collecting, I'm getting an informative warning from hub_path <- system.file("testhubs/empty", package = "hubUtils")
hub_con <- hubData::connect_hub(hub_path) |> dplyr::collect()
#> Warning in hubData::connect_hub(hub_path): No files of file formats "csv", "parquet", and "arrow" found in model output
#> directory.
#> Error in UseMethod("collect"): no applicable method for 'collect' applied to an object of class "c('hub_connection', 'list')" Created on 2024-03-27 with reprex v2.0.2 |
If I run the following in a hub that contains no model output files:
I get this error:
The text was updated successfully, but these errors were encountered: