Skip to content
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 new urls to metadata #795

Merged
merged 11 commits into from
Oct 19, 2023
Merged

Add new urls to metadata #795

merged 11 commits into from
Oct 19, 2023

Conversation

juliasilge
Copy link
Member

One thing we thought about when listening to JD Long's keynote talk at posit::conf last month was the value of making sure it is as easy as possible connect datasets to documentation. This PR is inspired by those thoughts and adds a new option for storing urls (a character vector) along with your dataset.

It's used like this:

library(pins)

b <- board_connect()
#> Connecting to Posit Connect 2023.07.0 at <https://colorado.posit.co/rsc>
b |> pin_write(
    c(200, 404, 503),
    "http-code-numbers",
    urls = c("https://httbey.com/", "https://http.cat/"),
    force_identical_write = TRUE
)
#> Guessing `type = 'rds'`
#> Writing to pin 'julia.silge/http-code-numbers'

Created on 2023-10-18 with reprex v2.0.2

I added the URLs to the Connect preview, which you can see here:
https://colorado.posit.co/rsc/httpbey-pin/

Any thoughts on a better way to present that?

@juliasilge juliasilge marked this pull request as ready for review October 19, 2023 01:09
@juliasilge juliasilge requested a review from hadley October 19, 2023 01:12
Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

R/pin-meta.R Outdated Show resolved Hide resolved
inst/preview/index.html Show resolved Hide resolved
R/pin-meta.R Outdated
@@ -133,6 +135,9 @@ test_api_meta <- function(board) {
testthat::expect_snapshot_error(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this test could be run just once for pin_write() since the code doesn't vary across backends?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great point, yep 👍

@juliasilge juliasilge merged commit f6c6f50 into main Oct 19, 2023
14 checks passed
@juliasilge juliasilge deleted the add-urls-to-metadata branch October 19, 2023 17:30
Copy link

github-actions bot commented Nov 3, 2023

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants