Skip to content

Bug using prefixed function names with dbplyr #1022

Closed
@akgold

Description

@akgold

When using functions in dplyr against databases, prefixing certain functions seems to cause those functions to evaluate variable names in the global context, not the context of the data frame.

This isn't quite reprex-able, because I am not including making the connection.

In my case, con is a connection to a Postgres database using RPostgres. I suspect that doesn't matter based on how the error is showing up.

df <- tbl(con, "my_table")
> df %>% mutate(status = paste(subject, "abc")) #this works
# Source:   lazy query [?? x 18]
# Database: postgres [db@db.rds.amazonaws.com:5432/postgres]
... #excluded for confidentiality
> df %>% mutate(status = base::paste(subject, "abc"))
Error in base::paste(subject, "abc") : object 'subject' not found

Metadata

Metadata

Assignees

Labels

bugan unexpected problem or unintended behaviorfunc trans 🌍Translation of individual functions to SQL

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions