Implement API endpoints related to fetching BERtron data#54
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds initial API endpoints to serve and query the MongoDB entities collection, including generic and geospatial search functionality.
- Introduces endpoints:
/bertron(list all),/bertron/find(dynamic queries),/bertron/geo/nearby,/bertron/geo/bbox, and/bertron/{id}. - Defines
MongoDBQueryPydantic model for flexible query parameters. docker-compose.ymlshows unresolved merge conflict markers that must be cleaned up.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/server.py | Implements new FastAPI routes for entity retrieval and querying (generic & geo). |
| docker-compose.yml | Contains merge conflict markers that prevent a valid YAML configuration. |
Comments suppressed due to low confidence (4)
src/server.py:239
- [nitpick] Using 'id' shadows the built-in function
idand is ambiguous; consider renaming to 'entity_id' for clarity.
def get_entity_by_id(id: str):
src/server.py:56
- This new endpoint lacks associated tests; consider adding unit tests to cover the query functionality and edge cases.
@app.post("/bertron/find")
docker-compose.yml:53
- Unresolved merge conflict marker '<<<<<<< HEAD' in docker-compose.yml; resolve the conflict and remove these markers.
<<<<<<< HEAD
docker-compose.yml:65
- Unresolved merge conflict marker '>>>>>>> main' in docker-compose.yml; resolve the conflict and remove these markers.
>>>>>>> main
Comment on lines
7
to
8
| import json | ||
|
|
There was a problem hiding this comment.
The 'json' import is not used and can be removed to clean up unused imports.
Suggested change
| import json |
jeff-cohere
reviewed
Jun 12, 2025
| - mongo | ||
| # Run ingest with data dir mounted to /data | ||
| command: ["uv", "run", "python", "/app/mongodb/ingest_data.py", "--mongo-uri", "mongodb://admin:root@mongo:27017", "--input", "/data"] | ||
| <<<<<<< HEAD |
Collaborator
There was a problem hiding this comment.
This looks like an unresolved conflict.
jeff-cohere
requested changes
Jun 12, 2025
Collaborator
jeff-cohere
left a comment
There was a problem hiding this comment.
Looks good, aside from some unresolved conflict kibble and formatting changes. I'll approve after these are fixed.
eecavanna
approved these changes
Jun 12, 2025
jeff-cohere
approved these changes
Jun 12, 2025
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.
Initial support for API endpoints.
Note that we aren't using the Pydantic LinkML model for BERTron yet because the DB expects things to be in GeoJSON. This is converted on ingest, but once the schema supports GeoJSON it should simplify things.