[Rd] RC / methods package

From: Paul Gilbert <pgilbert902_at_gmail.com>
Date: Sat, 24 Mar 2012 16:29:59 -0400


(I think this is being caused by the new methods package in RC.)

In the RC (March 24) some of my packages are generating a Note

Note: Method with signature "MySQLConnection#integer" chosen for function "coerce",
  target signature "TSMySQLConnection#integer".   "dbObjectId#integer" would also be valid

This is coming from a call to dbGetQuery() in package DBI. The method with the signature "TSMySQLConnection#integer" is generated automatically because TSMySQLConnection inherits from MySQLConnection. (More details below.)

Is there a way to pass this information along to coerce when the method is generated, or otherwise suppress the Note?

BTW,
  1/ It would be nice if the Note mentioned what method is generating it, in addition to the signature. Debugging for a call several levels deep in the stack is already hard enough.

  2/ The note only seems to get generated on the first call and then gets suppressed. This will be nice for users, but makes debugging harder. Is there a way to prevent suppressing the message?

  3/ It seems strange that getMethod() cannot find the methods even though showMethods() shows it. (See below.)

Paul


>showMethods("dbGetQuery")

Function: dbGetQuery (package DBI)
conn="MySQLConnection", statement="character"

> z <- TSget("Series 1", con, TSrepresentation="timeSeries")
Note: Method with signature "MySQLConnection#integer" chosen for function "coerce",
  target signature "TSMySQLConnection#integer".   "dbObjectId#integer" would also be valid Loading required package: zoo

Attaching package: ‘zoo’

The following object(s) are masked from ‘package:timeSeries’:

     time<-

The following object(s) are masked from ‘package:base’:

     as.Date, as.Date.numeric

> showMethods("dbGetQuery")

Function: dbGetQuery (package DBI)
conn="MySQLConnection", statement="character" conn="TSMySQLConnection", statement="character"

     (inherited from: conn="MySQLConnection", statement="character")

> getMethod("dbGetQuery", signature = c("TSMySQLConnection",
statement="character"))
Error in getMethod("dbGetQuery", signature = c("TSMySQLConnection", statement = "character")) :

   No method found for function "dbGetQuery" and signature TSMySQLConnection, character
>



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 24 Mar 2012 - 20:32:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 25 Mar 2012 - 19:50:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive