-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dimnames.data.table short use inherits, not identical #1678
Comments
This issue is not related just to that method, having other classes as leading results into multiple issues because of dispatching, there was discussion on that somewhere in issues |
just to be sure I understand, you mean this issue is nested within another, broader one? |
@jangorecki got it. but check out my PR for this issue -- it seems this problem in particular is on the |
Could you provide a reproducible example of the issue? I don't follow what the issue is or what the fix does. Specifically, why do you check if an object is a data.frame inside a function that's a S3 method for objects that inherits data.table? |
@arunsrinivasan Check the SO post; they don't really provide an example, but my understanding is a The issue is a The original approach of the test was too strict -- requiring anything sent to The fix in my PR is to only test that the Hope that's clear enough. I couldn't reproduce it myself. Now I'm thinking that we could probably just skip that test altogether, and just send straight to |
Thanks. The issue seems to be checking for exact class. It should be |
@arunsrinivasan I'm not sure that's exactly right. I'm leaning towards ditching that test altogether; see my comment below yours. |
Closes #1678; dimnames.data.table properly uses inherits to check data.frame awareness
Currently, internal
dimnames.data.table
requires theclass
to bec("data.table", "data.frame")
, but when users are mixing with the Hadleyverse, theirdata.table
might end up with other classes tacked on as well.See this SO post, for example, where
class(dt)
ended up asc("grouped_dt", "tbl_dt", "tbl", "tbl_dt", "tbl", "data.table", "data.frame")
(kind of silly, but it's beyond our control).The text was updated successfully, but these errors were encountered: