OpenRefine / OpenRefine/openrefine.org
Correct documentation for row.record.cells variable
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 161
- Forks
- 142
- Avg merge
- 6h 10m
- Merged PRs (30d)
- 9
Description
From Forum https://forum.openrefine.org/t/row-record-cells-is-not-an-array/2620/7
The documentation currently has the entry:
| Field | Meaning |
|---|---|
row.record.cells |
An array of the cells in the given column of the record |
This is both incorrect (this actually returns a RecordCells object) and isn't incredibly helpful to the user as it is not obvious how to extract cell objects or their properties (particularly values) from this object. It is required to provide a column name to get an array of Cell objects. e.g:
row.record.cells.columnName
or
row.record.cells["column name"]
This returns an array of the non-blank cells in that column in the record. The properties of the cells in the array can be extracted by dot chaining the relevant cell property on the end:
row.record.cells["column name"].valuerow.record.cells["column name"].reconrow.record.cells["column name"].errorMessage
But note that unless the value is set, the cells won't be included in the array - so cells that are storing an errorMessage rather than a value won't be included. (I'm not sure if it is possible for a cell to store an error message and a value?)
At the least the documentation should be updated to indicate users should use row.record.cells.columnName or row.record.cells["column name"] to get the cells from which values can be extracted
`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documentation entry for row.record.cells and review the linked forum discussion for the expected behavior. Update the description to identify the RecordCells object, show column-name access and cell-property examples, and explain the non-blank cell behavior; done when the documentation matches these examples.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100