Skip to content

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

@salim-b

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions