-
Notifications
You must be signed in to change notification settings - Fork 11
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
add_resource(replace = TRUE)
fails silently if resource does not exist
#259
Comments
replace=TRUE
prevent the addition of a new resource
You didn't assign your first library(frictionless)
package <- example_package()
# Create a data frame
df <- data.frame(
multimedia_id = c(
"aed5fa71-3ed4-4284-a6ba-3550d1a4de8d",
"da81a501-8236-4cbd-aa95-4bc4b10a05df"
),
x = c(718, 748),
y = c(860, 900)
)
package <- add_resource(package, "positions", data = df)
add_resource(package, "positions", data = df, replace = TRUE)
#> A Data Package with 4 resources:
#> • deployments
#> • observations
#> • media
#> • positions
#> Use `unclass()` to print the Data Package as a list. Created on 2024-08-28 with reprex v2.1.0 However - and I'm not sure that this is what you wanted to point out - if you replace a resource that is not there, then nothing happens. It's probably better if:
I prefer the latter. |
replace=TRUE
prevent the addition of a new resourceadd_resource(replace = TRUE)
fails silently if resource does not exist
Yes, that's what I wanted to show (it works without Ok, I personally prefer the traditional |
Changed my mind, I agree that |
What about the case where you might want to literally add data to an exsiting resources (i.e., with a |
Hi,
Is this desired? I would expect that
replace=TRUE
should not prevent the addition of a new (non-yet-exisiting) resource.I didn't look at the function, so not sure why this is happening.
The text was updated successfully, but these errors were encountered: