Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is a release for version 0.12.4 that claims to fix exact search functionality for geo and bed ID. However, the actual code changes only address bed ID exact search logic, while the geo search fix may be contained in the bbconf library dependency update.
Changes:
- Version bumped from 0.12.3 to 0.12.4
- Updated bbconf dependency from >=0.14.2 to >=0.14.4
- Added null check for bed metadata and modified return logic in bed ID exact search
- Updated Vite worker configuration for ES module format and WASM support
- Updated refgenie URL from deprecated endpoint to current API endpoint
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bedhost/_version.py | Version bump to 0.12.4 |
| requirements/requirements-all.txt | Updated bbconf dependency to >=0.14.4 (may contain geo search fixes) |
| bedhost/routers/bed_api.py | Added metadata validation and modified exact bed ID search logic with new error handling |
| ui/vite.config.ts | Added worker configuration for ES module format with WASM plugin support |
| ui/src/components/bed-splash-components/header.tsx | Updated refgenie URL from deprecated v3 HTTP endpoint to current v4 HTTPS API endpoint |
Comments suppressed due to low confidence (2)
bedhost/routers/bed_api.py:492
- The outer try-except block silently catches all exceptions (line 491-492) with just
pass. This means that if an exact bed ID lookup succeeds but the metadata is None (raising BEDFileNotFoundError on line 471), this error will be caught and ignored, causing the function to fall through to the geo/encode search or hybrid search below. This seems like unintended behavior - if an exact ID match is found but has no metadata, that should likely return an error rather than falling back to other search methods. Consider either removing the outer try-except or being more specific about which exceptions to catch and ignore.
try:
result = QdrantSearchResult(
id=query,
payload={},
score=1.0,
metadata=bbagent.bed.get(query),
)
if result.metadata is None:
raise BEDFileNotFoundError(f"Bed file with id {query} not found")
try:
similar_results = bbagent.bed.get_neighbours(
query, limit=limit, offset=offset
)
if similar_results.results and offset == 0:
similar_results.results.insert(0, result)
return similar_results
else:
raise BEDFileNotFoundError(f"Similar beds not found")
except Exception as _:
similar_results = BedListSearchResult(
count=1,
limit=100,
offset=0,
results=[result],
)
return similar_results
except Exception as _:
pass
bedhost/routers/bed_api.py:488
- The logic in this try-except block is problematic. When
offset > 0or whensimilar_results.resultsis empty/falsy, line 481 raisesBEDFileNotFoundError. However, this exception is immediately caught by theexcept Exception as _:block on line 482, which creates a fallback result. This means the intentionally raised exception is being silently caught and handled.
If the intent is to return an error when similar beds are not found for non-zero offsets, the exception should not be caught by the surrounding try-except. Consider either:
- Restructuring the logic so the BEDFileNotFoundError is not caught by the same try-except block
- Using a more specific exception type in the except clause that doesn't catch BEDFileNotFoundError
- Re-raising the BEDFileNotFoundError in the except clause if that's what was caught
try:
similar_results = bbagent.bed.get_neighbours(
query, limit=limit, offset=offset
)
if similar_results.results and offset == 0:
similar_results.results.insert(0, result)
return similar_results
else:
raise BEDFileNotFoundError(f"Similar beds not found")
except Exception as _:
similar_results = BedListSearchResult(
count=1,
limit=100,
offset=0,
results=[result],
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying bedhost-ui with
|
| Latest commit: |
30365cf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e46d90b1.bedhost.pages.dev |
| Branch Preview URL: | https://search-fix.bedhost.pages.dev |
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.
Changes:
Pre-AI PR
TODO:
__version__.pyfile