RMySQL icon indicating copy to clipboard operation
RMySQL copied to clipboard

Type warnings on MySQL and dplyr::mutate

Open JohnMount opened this issue 8 years ago • 0 comments

This is likely related to https://github.com/rstats-db/RMySQL/issues/37 , but I can't get type warnings to stop when using RMySQL and dplyr::mutate together. Even placing dplyr::compute() in a suppressWarnings() doesn't help as the warning isn't generate until printing time (and the printing may be done by a user later, the computation I am modeling would be inside a package function).

Example:

library('dplyr')
my_db <- src_mysql('mysql','127.0.0.1',3306,'root','passwd')
d4 <- copy_to(my_db,data.frame(x=c(1,2,3,3)),'d4')
suppressWarnings(
  d4 %>% mutate(z=1) %>% compute() -> d4
)
print(d4)

 # Source:   query [?? x 2]
 # Database: mysql 5.6.34 [[email protected]:/mysql]
 #
 #       x     z
 #   <dbl> <dbl>
 # 1     1     1
 # 2     2     1
 # 3     3     1
 # 4     3     1
 # Warning message:
 # In .local(conn, statement, ...) :
 #   Decimal MySQL column 1 imported as numeric
> packageVersion('dplyr')
[1] ‘0.5.0’
> packageVersion('RMySQL')
[1] ‘0.10.9’

JohnMount avatar Nov 30 '16 18:11 JohnMount