Skip to content

Avoid linking rows with NULL primary keys - #2965

Open
sb123sb123 wants to merge 1 commit into
simonw:mainfrom
sb123sb123:fix/null-primary-key-row-links-2145
Open

sb123sb123 wants to merge 1 commit into
simonw:mainfrom
sb123sb123:fix/null-primary-key-row-links-2145

Conversation

@sb123sb123

@sb123sb123 sb123sb123 commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

  • Render rows with NULL primary-key values as plain text instead of linking them to an invalid row URL.
  • Omit inline Edit and Delete actions for rows whose NULL keys cannot reliably identify a row.
  • Preserve links and actions for valid keys, including a literal text key of None.

Fixes #2145

Validation

  • uv run --python 3.13 --group dev pytest -q tests/test_table_html.py: 109 passed on macOS.
  • ruff check tests/test_table_html.py datasette/views/table.py: passed.
  • black --check --target-version py310 tests/test_table_html.py datasette/views/table.py: passed.
  • Read the Docs check: passed.

The same full test module hit temporary-directory cleanup errors when run on the separate Windows G-drive environment (97 passed, 12 failed, 1 error); the isolated failure was also reproducible in the unchanged test_table_cell_truncation test. The complete module passes on macOS.

This branch has not been deployed

No deployments
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.

If a row has a primary key of null various things break

1 participant