Skip to content

Commit 81ca197

Browse files
authored
Merge pull request #336 from frictionlessdata/remove-warning
Remove read_package v2 warning
2 parents 4e8348a + ca9d0e5 commit 81ca197

5 files changed

Lines changed: 5 additions & 25 deletions

File tree

R/read_package.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ read_package <- function(file = "datapackage.json") {
4444
)
4545
}
4646

47-
# Warn if version >= 1.0
48-
version <- version(descriptor)
49-
if (version != "1.0") {
50-
cli::cli_warn(
51-
"This Data Package uses a version ({.field {version}}) not supported by
52-
this version of {.pkg frictionless}. Expect errors.",
53-
class = "frictionless_warning_version_not_supported"
54-
)
55-
}
56-
5747
# Add directory
5848
attr(descriptor, "directory") <- dirname(file) # Also works for URLs
5949

tests/testthat/test-example_package.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ test_that("example_package() allows version selection (default 1.0)", {
22
p_v1 <- read_package(
33
system.file("extdata", "v1", "datapackage.json", package = "frictionless")
44
)
5-
p_v2 <- suppressWarnings(read_package(
5+
p_v2 <- read_package(
66
system.file("extdata", "v2", "datapackage.json", package = "frictionless")
7-
))
7+
)
88

99
expect_identical(example_package("1.0"), p_v1)
10-
expect_identical(suppressWarnings(example_package("2.0")), p_v2)
10+
expect_identical(example_package("2.0"), p_v2)
1111
expect_identical(example_package("not_a_version"), p_v1)
1212
expect_identical(example_package(version = NULL), p_v1)
1313
})

tests/testthat/test-print.datapackage.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_that("print.datapackage() informs about the version, resources and
2323
)
2424

2525
# Version 2.0 with 3 resources
26-
p <- suppressWarnings(example_package(version = "2.0"))
26+
p <- example_package(version = "2.0")
2727
expect_output(
2828
print(p),
2929
regexp = paste(

tests/testthat/test-read_package.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,6 @@ test_that("read_package() warns if resources are missing", {
107107
)
108108
})
109109

110-
test_that("read_package() warns if version is not supported", {
111-
expect_no_warning(
112-
example_package(version = "1.0")
113-
)
114-
expect_warning(
115-
example_package(version = "2.0"),
116-
class = "frictionless_warning_version_not_supported"
117-
)
118-
})
119-
120110
test_that("read_package() allows descriptor at absolute or relative parent
121111
path", {
122112
relative_path <- "../testthat/data/valid_minimal.json"

tests/testthat/test-version.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ test_that("version() returns >=2.0 for invalid $schema", {
3939
test_that("version() returns correct version for example packages", {
4040
p_1.0 <- example_package(version = "1.0")
4141
expect_equal(version(p_1.0), "1.0")
42-
p_2.0 <- suppressWarnings(example_package(version = "2.0"))
42+
p_2.0 <- example_package(version = "2.0")
4343
expect_equal(version(p_2.0), "2.0")
4444
})

0 commit comments

Comments
 (0)