Fix docs data-preview: column order and label linkification#530
Merged
Conversation
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>
There was a problem hiding this comment.
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.readFillersto read headers in file order viaallWithOrderedHeaders()instead of deriving order from map keys. - Update docs preview row formatting to linkify only entity-valued columns (pattern
vars,list_vars, anddefined_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.