Refactor queue routes, update LinkedIn and Apollo CSV imports#96
Merged
goldlabelapps merged 5 commits intomasterfrom Apr 22, 2026
Merged
Refactor queue routes, update LinkedIn and Apollo CSV imports#96goldlabelapps merged 5 commits intomasterfrom
goldlabelapps merged 5 commits intomasterfrom
Conversation
Delete the standalone /queue/next route (remove app/api/queue/routes/next.py and unregister its router in app/api/queue/__init__.py). Also adjust the GET queue endpoint's meta message from "Queue table info" to "Next in queue" to better reflect the returned data.
Switch linkedin import to use the sample CSV and handle both 'Position' and 'Job' headers by normalizing 'Position' to 'Job'. Map row values to job (row.get('Job') or row.get('Position')) and update INSERTs to use the job column. Update the queue GET route meta/title and include an "in_queue" count in the response payload. Update tests to expect the new response keys and meta title.
Rename apollo seed.csv to sample.csv and implement actual CSV parsing + batched DB inserts for Apollo imports (batch_size=500). Map Apollo columns into queue fields, set collection/group, track imported_count, and update error messages to reference sample.csv. Adjust LinkedIn import row layout and SQL column order to include updated/hidden/created fields and place name/linkedin columns in the correct positions for executemany inserts.
Remove the 'in_queue' key from the read_queue response payload because it duplicated the 'total' value (total_count). This eliminates a redundant field and reduces confusion in the API response.
Rename prompt/drop to prompt/empty and update router imports and handler names for clarity. Files changed: app/api/prompt/drop.py -> app/api/prompt/empty.py (endpoint path /prompt/empty, handler empty_prompt_table, removed unused os import), app/api/prompt/__init__.py and app/api/routes.py (update imports and router include names). Also adjust queue GET response shape (app/api/queue/routes/get.py) to group collection/group values and collections/groups under a new "filters" object with keys collectionFilter and groupFilter. Clients should be updated to use the new endpoint and the revised queue response structure.
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.
This pull request introduces several improvements and refactorings across the API endpoints, focusing primarily on enhancing prompt and queue management, streamlining code organization, and improving CSV import functionality. The most notable changes include refactoring prompt-related endpoints for clarity, updating queue CSV import logic for robustness and accuracy, and removing unused or redundant endpoints.
Prompt API improvements:
GET /promptendpoint toGET /prompts, which now returns prompt table metadata (record_countandcolumns) instead of paginated prompt records. The previous paginated listing logic was removed to simplify the endpoint. (app/api/prompt/prompt.py,README.md) [1] [2]/prompt/dropto/prompt/empty, and updated all imports and references accordingly. (app/api/prompt/empty.py,app/api/prompt/__init__.py,app/api/routes.py) [1] [2] [3] [4]Queue CSV import enhancements:
app/api/queue/csv/apollo.py)app/api/queue/csv/linkedin.py)Queue API and code cleanup:
/queue/nextendpoint and its router, consolidating queue record retrieval logic elsewhere. (app/api/queue/routes/next.py,app/api/queue/__init__.py) [1] [2] [3]filtersobject in the response, clarifying which filters were applied and improving the structure of returned metadata. (app/api/queue/routes/get.py)tests/test_queue.py)