Skip to content

Conversation

@aitap
Copy link
Member

@aitap aitap commented Dec 20, 2025

Before #7451, removing a column was always possible, because using SETLENGTH to reduce the length of a data.table was mostly unchecked (and didn't cause problems in practice, modulo the allocated memory count sometimes being wrong), even if it was not created by data.table code in the current R session. R_resizeVector now requires its argument to be resizable, and freshly unserialized data.tables don't pass the mark: ones created by older versions of data.table lack the growable bit, and ones created after #7451 latest version still have a zero TRUELENGTH.

Solution:

  • call selfrefok even if not adding new columns
  • if jval indicates removing a column, call setalloccol to prevent the error

Could the test for := removing a column be improved? (What about list columns containing NULLs?)

Fixes: #7488

@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.04%. Comparing base (be67a4d) to head (8773401).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7492   +/-   ##
=======================================
  Coverage   99.04%   99.04%           
=======================================
  Files          87       87           
  Lines       16671    16678    +7     
=======================================
+ Hits        16511    16518    +7     
  Misses        160      160           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

  • HEAD=more-setalloccol stopped early for DT[,.SD] improved in #4501
  • HEAD=more-setalloccol slower P<0.001 for isoweek improved in #7144
    Comparison Plot

Generated via commit 8773401

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

Task Duration
R setup and installing dependencies 5 minutes and 5 seconds
Installing different package versions 11 minutes and 15 seconds
Running and plotting the test cases 5 minutes and 25 seconds

@ben-schwen
Copy link
Member

TYVM!

@ben-schwen ben-schwen merged commit b0b8b23 into master Dec 20, 2025
12 checks passed
@ben-schwen ben-schwen deleted the more-setalloccol branch December 20, 2025 22:27
@ben-schwen
Copy link
Member

@TysonStanley if still possible, we should squeeze this one into release, since otherwise we will get caught by revdeps

@TysonStanley
Copy link
Member

Great! I'm using what is in master by tonight if that works for the team. @ben-schwen @aitap @jangorecki @MichaelChirico

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.

serialized data.tables from before cannot be read out of the box

3 participants