Repository navigation
Fall back to site homepage when an xref has no link_base - #142
Merged
Merged
Conversation
Xref.link() (and the vfb_queries term-info flattener) joined the accession onto an empty link_base, so Sites without one emitted the bare accession as a relative URL, e.g. /org.geppetto.frontend/sample-1099 on the Randel2026 dataset page and the skid on each of its 178 activity-tagged neurons. Only build the external link when a link_base exists; otherwise use the site's homepage, then its iri. Tests cover all three cases and a None postfix.
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.
Xref.link()and the term-info flattener invfb_queries.pyjoined the accession onto an emptylink_base, so a Site without one emitted the bare accession as a relative URL — e.g./org.geppetto.frontend/sample-1099on the Randel2026 dataset page, and the CATMAID skid on each of its 178 activity-tagged neurons (Sitelarva1099_activity).Only build the external link when a
link_baseexists; otherwise use the Site'shomepage, then itsiri.ha_api._xref_rowsalready returned an empty link in this case and is unchanged.Tests:
tests/test_xref_link_fallback.pycovers link_base present, homepage fallback, iri fallback and aNonepostfix.tests/test_xref.pystill passes.After release: force-refresh the cached term info for
Randel2026and the 178 neurons (cache keys are per major.minor, so a patch release alone won't evict them).