You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My proposed fix focuses entirely on clarifying the static snapshot nature of .SD to prevent future confusion.
Here are the specific documentation files I propose to modify:
man/special-symbols.Rd: To add a critical note explicitly defining .SD as a static copy initialized before the j expression begins, explaining why local assignments are ignored by .SD.
vignettes/datatable-sd-usage.Rmd: To incorporate a concrete example (like the one in the issue description) that clearly contrasts returning .SD versus returning explicit columns (.(a, b, d)) after a local vector modification.
Does this targeted documentation plan sound good to you? If so, I am happy to proceed with a Pull Request.
Thanks!
To not break existing workflows probably warning would be better. Question is to what degree we are able to "scan" j for assignments to columns that exist in .SD with a minimal overhead. There are many corner cases but even catching simple ones like those may cover majority of use cases.
Activity
MichaelChirico commentedon Nov 18, 2025
This is a documentation issue IMO. I don't think there's any way to make this work as you'd hoped.
.SDis populated up-front, not dynamically/lazily.venom1204 commentedon Nov 28, 2025
Hi @MichaelChirico @tdhock ,
My proposed fix focuses entirely on clarifying the static snapshot nature of .SD to prevent future confusion.
Here are the specific documentation files I propose to modify:
Does this targeted documentation plan sound good to you? If so, I am happy to proceed with a Pull Request.
Thanks!
tdhock commentedon Nov 28, 2025
is that true? if so an error would be better.
jangorecki commentedon Nov 28, 2025
To not break existing workflows probably warning would be better. Question is to what degree we are able to "scan" j for assignments to columns that exist in .SD with a minimal overhead. There are many corner cases but even catching simple ones like those may cover majority of use cases.