-
Notifications
You must be signed in to change notification settings - Fork 2
Implement API endpoints related to fetching BERtron data #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/server.py
Outdated
| import json | ||
|
|
Copilot
AI
Jun 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'json' import is not used and can be removed to clean up unused imports.
| import json |
docker-compose.yml
Outdated
| - 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an unresolved conflict.
jeff-cohere
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, aside from some unresolved conflict kibble and formatting changes. I'll approve after these are fixed.
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.