Improve precision/helpfulness of "at an earlier point" error message for selfrefok miss

Open
#6,494 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, r
Domain
data

Research direction

Start with src/assign.c around line 526 and read the linked discussion in pull request #6419, including the notes about R's shallow_duplicate(). Compare this error with the similar message added by #6419; done means the selfrefok miss explains the likely cause more precisely and gives users clearer guidance.

Written by the indexing model from the issue text.

Description

by-reference

https://github.com/Rdatatable/data.table/blob/038ce2b79cc0bbf90cc9f7012dcac82029cad100/src/assign.c#L526

@HughParsonage flagged that telling user "at an earlier point" "something happened" is not the most helpful error to see:

https://github.com/Rdatatable/data.table/pull/6419#discussion_r1735815154

#6419 adds a similar message in a different place. As pointed out by @aitap, the root cause (IINM in both cases) is R doing a shallow_duplicate(): https://github.com/Rdatatable/data.table/pull/6419#discussion_r1755333034

I believe that means there's no real way for us to fully prevent the user from getting their table into a broken state (which would make sense as a reason why we wanted to start tracking .internal.selfref in the first place long ago).

But armed with a more precise understanding of the underlying issue, we can probably give the user an easier time understanding what's gone wrong & what to do about it.

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.