Show deprecation warning for Data Packages created with previous versions of frictionless#294
Show deprecation warning for Data Packages created with previous versions of frictionless#294peterdesmet wants to merge 7 commits into
Conversation
Rather, create a valid package and remove the element to test
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 658 670 +12
=========================================
+ Hits 658 670 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
All functions should work on older packages, that is currently not the case:
library(frictionless)
p <- movepub::o_assen
p
#> Warning: `package$directory` was deprecated in frictionless 1.3.0.
#> ℹ This Data Package was created with an older version of frictionless. Read or
#> create it again to avoid this warning.
#> ℹ The deprecated feature was likely used in the frictionless package.
#> Please report the issue at
#> <https://github.com/frictionlessdata/frictionless-r/issues>.
#> This warning is displayed once per session.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> A Data Package with 2 resources:
#> • reference-data
#> • gps
#> For more information, see <https://doi.org/10.5281/zenodo.10053903>.
#> Use `unclass()` to print the Data Package as a list.
resource_names(p)
#> [1] "reference-data" "gps"
read_resource(p, "reference-data")
#> Error in `purrr::map_chr()` at frictionless-r/R/resource.R:60:7:
#> ℹ In index: 1.
#> Caused by error in `check_path()`:
#> ! Can't find file at 'O_ASSEN-reference-data.csv'.
write_package(p, "o_assen")
#> Error in `purrr::map_chr()` at frictionless-r/R/resource.R:60:7:
#> ℹ In index: 1.
#> Caused by error in `check_path()`:
#> ! Can't find file at 'O_ASSEN-reference-data.csv'.
add_resource(p, "iris", iris)
#> A Data Package with 3 resources:
#> • reference-data
#> • gps
#> • iris
#> For more information, see <https://doi.org/10.5281/zenodo.10053903>.
#> Use `unclass()` to print the Data Package as a list.
create_package(p)
#> A Data Package with 2 resources:
#> • reference-data
#> • gps
#> For more information, see <https://doi.org/10.5281/zenodo.10053903>.
#> Use `unclass()` to print the Data Package as a list.Created on 2026-04-13 with reprex v2.1.1 |
|
@sannegovaert @PietrH we have two options when a user has stored a Data Package object (e.g. as an rda) created with an older version of frictionless. Which one do you prefer? Option 1
or: Option 2
The decision also has future implications: with frictionless v2, we might want to upconvert other aspects. The question is whether this should be done by |
|
I lean towards option 2, but I don't have strong feelings about it. Having it done by the user makes it clearer to the user that something has changed. But it might be inconvenient I suppose, adding friction. |
|
I assume there are not many other cases where a frictionless Data Package is stored somewhere? In that case I think option 2 is fine. |
Not with check_package()!
|
Thanks for the feedback, I have opted for version 2. The user has to update the stored Data Package object with
This is the workflow: library(frictionless)
p_old <- movepub::o_assen
# DEPRECATION WARNING WITH TIP TO USE create_package()
p_old
#> Warning: `package$directory` was deprecated in frictionless 1.3.0.
#> ℹ This Data Package object was created with an older version of frictionless.
#> Update it with `create_package()`.
#> ℹ The deprecated feature was likely used in the frictionless package.
#> Please report the issue at
#> <https://github.com/frictionlessdata/frictionless-r/issues>.
#> This warning is displayed once per session.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> A Data Package with 2 resources:
#> • reference-data
#> • gps
#> For more information, see <https://doi.org/10.5281/zenodo.10053903>.
#> Use `unclass()` to print the Data Package as a list.
# I DON'T READ THE MESSAGE => THINGS BREAK
read_resource(p_old, "reference-data")
#> Error in `purrr::map_chr()` at frictionless-r/R/resource.R:60:7:
#> ℹ In index: 1.
#> Caused by error in `check_path()`:
#> ! Can't find file at 'O_ASSEN-reference-data.csv'.
# FINE, I'LL UPDATE
p_new <- create_package(p_old)
# THINGS WORK NOW
read_resource(p_new, "reference-data")
#> # A tibble: 7 × 27
#> `tag-id` `animal-id` `animal-taxon` `deploy-on-date` `deploy-off-date`
#> <chr> <chr> <chr> <dttm> <dttm>
#> 1 5635 5515867 Haematopus ostra… 2018-05-04 09:30:00 2019-05-09 21:28:00
#> 2 5644 5515868 Haematopus ostra… 2018-05-04 11:43:00 NA
#> 3 5628 5515869 Haematopus ostra… 2018-05-09 10:15:00 NA
#> 4 5642 5515851 Haematopus ostra… 2018-05-09 14:15:00 NA
#> 5 5821 5515878 Haematopus ostra… 2019-05-09 19:45:00 NA
#> 6 5822 5515879 Haematopus ostra… 2019-05-09 20:30:00 2019-05-14 00:00:00
#> 7 5750 5515867 Haematopus ostra… 2019-05-10 09:00:00 NA
#> # ℹ 22 more variables: `alt-project-id` <chr>, `animal-comments` <chr>,
#> # `animal-life-stage` <chr>, `animal-mass` <dbl>, `animal-nickname` <chr>,
#> # `animal-ring-id` <chr>, `animal-sex` <chr>, `attachment-type` <chr>,
#> # `deploy-on-latitude` <dbl>, `deploy-on-longitude` <dbl>,
#> # `deploy-on-measurements` <chr>, `deployment-comments` <chr>,
#> # `deployment-end-type` <chr>, `deployment-id` <chr>,
#> # `location-accuracy-comments` <chr>, `manipulation-type` <chr>, …Created on 2026-05-13 with reprex v2.1.1 |
Fix #293.
@sannegovaert this should resolve issues you had with
river_telemetryando_assenwhile frictionless 1.2.1.9000 was loaded.You can test with: