-
Notifications
You must be signed in to change notification settings - Fork 0
Bump version and enhance prospects init #29
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| """NX AI - FastAPI/Python/Postgres/tsvector""" | ||
|
|
||
| # Current Version | ||
| __version__ = "1.1.5" | ||
| __version__ = "1.1.6" |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,13 +5,14 @@ | |||||||
| from app.utils.db import get_db_connection | ||||||||
|
|
||||||||
| router = APIRouter() | ||||||||
|
|
||||||||
|
|
||||||||
| base_url = os.getenv("BASE_URL", "http://localhost:8000") | ||||||||
|
|
||||||||
| @router.get("/prospects") | ||||||||
| def root() -> dict: | ||||||||
| """Return a placeholder message for prospects endpoint.""" | ||||||||
| meta = make_meta("success", "Prospects placeholder") | ||||||||
|
||||||||
| meta = make_meta("success", "Prospects placeholder") | |
| meta = make_meta("success", "Prospects placeholder") | |
| base_url = meta.get("base_url", "").rstrip("/") # Derive from meta to keep URLs consistent |
Copilot
AI
Mar 27, 2026
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.
Defining slugify() inside the request handler (and importing re inside the helper) adds per-request overhead and makes the helper harder to reuse/test. Consider moving slugify (and the re import) to module scope, outside the try: block.
Copilot
AI
Mar 27, 2026
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 response now slices to the top 3 values, but the queries still fetch all grouped rows (fetchall()), which can be expensive with many distinct titles/seniority/departments. Consider using LIMIT 3 for the top lists and a separate COUNT(DISTINCT ...) query for total_unique to avoid transferring/processing large result sets.
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.
There’s trailing whitespace on this blank line, which tends to cause avoidable diffs/lint noise. Please remove the extra spaces.