Skip to content

Param name of pins::pin_find() is interpreted as regex #270

Closed

Description

@salim-b

pins::pin_find() and pins::pin_info() documentation about param name states:

The exact name of the pin to match when searching.

Under Details it additionally says:

For 'local' and 'packages' boards, the 'text' parameter searches the title and description of a pin using a regular expression.

I.e. it says nothing about name being interpreted as a regular expression. But it actually is.

pins::pin(x = mtcars,
          board = "local",
          name = "regex.unsafe.[name]")

# nothing found
pins::pin_find(board = "local",
               name = "regex.unsafe.[name]")
#>  A tibble: 0 x 4
#> … with 4 variables: name <chr>, description <chr>, type <chr>, board <chr>

#  wrapping `name` in literal sequence escapes `\\Q...\\E` makes the difference
pins::pin_find(board = "local",
               name = "\\Qregex.unsafe.[name]\\E")
#>  A tibble: 1 x 4
#>  name                description type  board
#>  <chr>               <chr>       <chr> <chr>
#>1 regex.unsafe.[name] ""          table local

Created on 2020-07-19 by the reprex package (v0.3.0)

So, my primary question: Is this the intended behaviour?

If so, the documentation should be fixed to be more clear, especially because the name param of other functions like pins::pin_get() and pins::pin_remove() is not interpreted as a regular expression.

Activity

  1. javierluraschi commented on Dec 11, 2020

    @javierluraschi
    Contributor

    Worth investigating...

  2. added a commit that references this issue on Dec 15, 2020
    371d7c7
  3. github-actions commented on Aug 30, 2022

    @github-actions

    This issue 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.

  4. locked and limited conversation to collaborators on Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions