render_cell plugin hook's row object is not a sqlite.Row
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.5k
- Forks
- 904
- Avg merge
- 4d 17h
- Merged PRs (30d)
- 18
Description
row - sqlite.Row
The SQLite row object that the value being rendered is part of
This appears to actually be a CustomRow, but I think that's unrelated to my issue.
I have a table:
CREATE TABLE IF NOT EXISTS "dss_job_stats"(
job_id integer not null references dss_job(id) on delete cascade,
host text not null,
// other columns elided as irrelevant
primary key (job_id, host)
);
On datasette 0.63.2, the render_cell hook receives a row value that looks like:
CustomRow([('job_id', {'value': 2, 'label': '2'}), ('host', 'cldellow.com')])
I expected the job_id value to be 2, but it's actually {'value': 2, 'label': '2'}.
I can work around this, but was wondering if this was intended behaviour?
Contributor guide
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 render_cell hook documentation and datasette/utils/init.py, especially the CustomRow implementation linked in the issue. Reproduce the hook with the shown dss_job_stats schema and inspect the row received by the plugin. Done means determining whether the documented sqlite.Row contract or the observed value shape is intended, then recording the agreed behavior in the relevant test or documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 48/100