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

setDT generates shallow copy earlier to avoid interfering with attributes of co-bound tables #6551

Merged
merged 12 commits into from
Oct 1, 2024

Conversation

MichaelChirico
Copy link
Member

Closes #4784. Original author: @OfekShilon.

This is #6470, reborn (again). I tried resolving the merge conflict on that PR but I was rejected trying to push to Ofek's fork:

 ! [remote rejected]   fix4784 -> fix4784 (refusing to allow a GitHub App to create or update workflow `.github/workflows/performance-tests.yml` without `workflows` permission)
error: failed to push some refs to 'https://github.com/OfekShilon/data.table.git'

Just FYI to @OfekShilon -- now that you're a project member, should the need arise, making branches on this repo going forward will avoid such issues.

Copy link

github-actions bot commented Sep 29, 2024

Comparison Plot

Generated via commit 21b33c8

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 3 minutes and 38 seconds
Installing different package versions 7 minutes and 20 seconds
Running and plotting the test cases 2 minutes and 19 seconds

@OfekShilon
Copy link
Contributor

OfekShilon commented Sep 29, 2024

Thank you @MichaelChirico. I feel I should say - not only I don't have access to my original fork, but I'm also currently not working with data.table and do not expect to be contributing in the foreseeable future. If you prefer to exclude me from the project members I completely understand.

@MichaelChirico
Copy link
Member Author

No worries @OfekShilon, you had mentioned similar elsewhere (can't see it right away). My comment is as much of a note to self/fellow readers as to you :)

Right now we don't have any policy for removing ppl from 'Maintainers', so the easier thing is to leave you in there and hope we'll see you back eventually! Thanks for all your contributions over the years 🙏

@MichaelChirico
Copy link
Member Author

@ben-schwen do you think there's any test we should add for your 2nd suggested change (running setalloccol() before setattr() for row.names?

@MichaelChirico
Copy link
Member Author

Answering my own question, run at 899e49b

d1=data.frame(a=1, row.names='b')
d1
#   a
# b 1
d2=d1
setDT(d2)
d1
#   a
# 1 1

@MichaelChirico
Copy link
Member Author

@ben-schwen based on the test failures I think this approach is the right way to go -- rather than relying on setalloccol() doing a shallow copy for us (which IINM it only does in certain cases), we are better of doing it directly. I don't think there's any issue with doing x = .shallow(x) here, right?

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.62%. Comparing base (d62aac9) to head (12083a7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6551   +/-   ##
=======================================
  Coverage   98.62%   98.62%           
=======================================
  Files          79       79           
  Lines       14449    14450    +1     
=======================================
+ Hits        14250    14251    +1     
  Misses        199      199           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

NEWS.md Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
@MichaelChirico

This comment was marked as off-topic.

@Anirban166

This comment was marked as off-topic.

@Anirban166

This comment was marked as off-topic.

@Anirban166

This comment was marked as off-topic.

@tdhock

This comment was marked as off-topic.

@Anirban166

This comment was marked as off-topic.

@MichaelChirico

This comment was marked as off-topic.

@MichaelChirico MichaelChirico merged commit b4538a0 into master Oct 1, 2024
3 of 4 checks passed
@MichaelChirico MichaelChirico deleted the fix4784 branch October 1, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setDT modifies the class of the origin data.frame
4 participants