Skip to content

Fix docs data-preview: column order and label linkification#530

Merged
balhoff merged 1 commit into
masterfrom
docs-table-fixes
May 21, 2026
Merged

Fix docs data-preview: column order and label linkification#530
balhoff merged 1 commit into
masterfrom
docs-table-fixes

Conversation

@balhoff
Copy link
Copy Markdown
Member

@balhoff balhoff commented May 21, 2026

Read TSV headers in file order via allWithOrderedHeaders instead of deriving them from Map keys (hash order), so the docs preview table matches the source file. Only linkify entity-valued columns (vars, list_vars, defined_class); free-text columns whose values may contain a colon were being misparsed as CURIEs and rendered as bogus OBO links.

Fixes #501.

Read TSV headers in file order via allWithOrderedHeaders instead of
deriving them from Map keys (hash order), so the docs preview table
matches the source file. Only linkify entity-valued columns (vars,
list_vars, defined_class); free-text columns whose values may contain a
colon were being misparsed as CURIEs and rendered as bogus OBO links.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes two issues in the docs “data preview” table rendering: (1) TSV/CSV columns are now preserved in the same order as the source file headers, and (2) only entity-valued columns are linkified so free-text label fields containing colons are not incorrectly treated as CURIEs.

Changes:

  • Update Generate.readFillers to read headers in file order via allWithOrderedHeaders() instead of deriving order from map keys.
  • Update docs preview row formatting to linkify only entity-valued columns (pattern vars, list_vars, and defined_class).
  • Add ZIO tests covering ordered headers, correct linkification, and colon-in-label handling.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/main/scala/org/monarchinitiative/dosdp/cli/Generate.scala Reads tabular headers in file order using allWithOrderedHeaders() to make column ordering deterministic and source-aligned.
src/main/scala/org/monarchinitiative/dosdp/cli/Docs.scala Restricts linkification to entity columns only, preventing bogus OBO links from free-text label values containing colons.
src/test/scala/org/monarchinitiative/dosdp/cli/ReadFillersTest.scala Adds regression test ensuring readFillers preserves column order from the input file.
src/test/scala/org/monarchinitiative/dosdp/cli/FormatDataRowTest.scala Adds regression tests for linkifying entity columns only and correctly rendering label strings containing colons.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@balhoff balhoff merged commit a2d7644 into master May 21, 2026
2 checks passed
@balhoff balhoff deleted the docs-table-fixes branch May 21, 2026 14:57
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.

docs output issue

2 participants