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 tags to metadata #175

Closed
juliasilge opened this issue Dec 6, 2022 · 4 comments
Closed

Add tags to metadata #175

juliasilge opened this issue Dec 6, 2022 · 4 comments
Assignees

Comments

@juliasilge
Copy link
Member

Related to rstudio/pins-r#570

Let's add the new tags option to the metadata in Python:

library(pins)
b <- board_rsconnect()
#> Connecting to RSC 2022.11.0 at <https://colorado.rstudio.com/rsc>
b %>% pin_meta("julia.silge/great-numbers")
#> List of 12
#>  $ file       : chr "great-numbers.rds"
#>  $ file_size  : 'fs_bytes' int 61
#>  $ pin_hash   : chr "4d1eb93dc2188114"
#>  $ type       : chr "rds"
#>  $ title      : chr "julia.silge/great-numbers: a pinned integer vector"
#>  $ description: NULL
#>  $ tags       : chr [1:2] "i-love-integers" "numbers-are-fun"
#>  $ created    : POSIXct[1:1], format: "2022-11-21 14:09:27"
#>  $ api_version: num 1
#>  $ user       : list()
#>  $ name       : chr "julia.silge/great-numbers"
#>  $ local      :List of 4
#>   ..$ dir       : 'fs_path' chr "~/Library/Caches/pins/rsc-e62371cfd77db754024f9c5ed3556a73/cc8ef31c-d6b3-4e0a-be8e-7992efffaee0/66084"
#>   ..$ url       : chr "https://colorado.posit.co/rsc/content/cc8ef31c-d6b3-4e0a-be8e-7992efffaee0/_rev66084/"
#>   ..$ version   : chr "66084"
#>   ..$ content_id: chr "cc8ef31c-d6b3-4e0a-be8e-7992efffaee0"

Created on 2022-12-05 with reprex v2.0.2

Once we have this implemented in R and Python, we can set tags = "vetiver" when we pin a vetiver model.

@machow
Copy link
Collaborator

machow commented Dec 16, 2022

Any pin saved with tags in the metadata is currently unreadable in pins-python 😭. I'll add tags to the metadata today... (sorry, not sure how I missed this in the PR)

maybe time in the near future to circle back to adding compatibility tests to the R ci (rstudio/pins-r#610)

@machow machow self-assigned this Dec 16, 2022
@machow
Copy link
Collaborator

machow commented Dec 20, 2022

pins with a tags field should at least be readable now in v0.7.3

@machow
Copy link
Collaborator

machow commented Dec 20, 2022

@juliasilge WDYT of us having R pins add tags metadata as either null or a list of strings? Currently, if you pin_write(..., tags="some_tag") it saves it as a string, rather than a list of strings.

AFAIK the result will be the same when reading meta into R (NULL or a vector of strings), so this is purely for convenience on the python side :) (which would be None, str, or list[str] right now)

@isabelizimm
Copy link
Collaborator

tags implemented as of v0.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants