Skip to content
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

shallow adds .internal.selfref to an input data.frame #5286

Closed
OfekShilon opened this issue Dec 12, 2021 · 0 comments · Fixed by #6459
Closed

shallow adds .internal.selfref to an input data.frame #5286

OfekShilon opened this issue Dec 12, 2021 · 0 comments · Fixed by #6459
Labels

Comments

@OfekShilon
Copy link
Contributor

OfekShilon commented Dec 12, 2021

The non-exported shallow is supposed to operate on data.frame arguments since 1.14.2. But:

> df=data.frame(a=1:10)
> attributes(data.table:::shallow(df))
$names
[1] "a"

$class
[1] "data.frame"

$row.names
 [1]  1  2  3  4  5  6  7  8  9 10

$.internal.selfref
<pointer: 0x56250b748b10>

It appears setselfref is called regardless of if the input is indeed a data.table.

Also, test 1984.27 was supposed to catch it - but the way data frames/tables comparison is coded in test currently it doesn't. The culprit are these lines in the comparison:

        setattr(xc,".internal.selfref",NULL)   # test 2212
        setattr(yc,".internal.selfref",NULL)

# Output of sessionInfo()
R4.0.5, data.table 1.14.3

OfekShilon added a commit to IstraResearch/data.table that referenced this issue Dec 12, 2021
Merge remote-tracking branch 'origin/4783_attr' into istra

# Conflicts:
#	NEWS.md
#	R/data.table.R
#	R/test.data.table.R
#	inst/tests/tests.Rraw
@OfekShilon OfekShilon added the bug label Oct 24, 2022
OfekShilon added a commit to IstraResearch/data.table that referenced this issue Dec 7, 2022
OfekShilon added a commit to IstraResearch/data.table that referenced this issue Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant