This pull request introduces several new features and improvements to the queue API, focusing on enhanced data management and robustness.#90
Merged
goldlabelapps merged 3 commits intomasterfrom Apr 18, 2026
Conversation
Improve queue API: make LinkedIn CSV import robust and batched, add column-rename endpoints, and return more recent records. Changes include: switch import to linkedin.csv with dynamic header detection, skip blank rows, batch inserts (500) with an added 'group' value and imported count returned; update get route to return 10 most-recent records instead of one; add new rename/rename_column route handlers to ALTER TABLE RENAME COLUMN with error handling; wire up the rename router in queue __init__.py and add a sample queue_output.txt. These updates improve import reliability and provide a programmatic column-rename API.
Read queue: query DISTINCT collection and group values and include them in the response (collections, groups). Rename response keys for clarity (queued -> in_queue, most_recent -> example and return only the first example). Import LinkedIn CSV: normalize CSV-to-DB mapping (url -> linkedin, email_address -> email), update batch tuple order and INSERT column list to match the renamed columns. Delete rename.py: remove the /queue/alter/rename_column route (runtime column rename endpoint) for safety. These changes expose more queue metadata for the UI and standardize field names used by the LinkedIn importer.
Add a new DELETE /queue/delete route to remove queue records by id and register it in the queue router. Change the GET queue summary to return a random example record (ORDER BY RANDOM() LIMIT 1) instead of the most recently updated records. Update the LinkedIn import to point to linkedin.csv instead of the sample file. Add a global RequestValidationError handler in app.main that returns errors using the existing make_meta format, and add required imports for that handler.
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.
The most important changes include adding endpoints for deleting queue records and renaming columns, improving the LinkedIn CSV import process for large files, updating the queue data retrieval to provide more useful information, and implementing a global validation error handler. These updates make the API more flexible, robust, and user-friendly.
New API Endpoints:
DELETE /queue/deleteendpoint to allow deletion of queue records by ID. [1] [2]POST /queue/alter/rename_columnendpoint to support renaming columns in thequeuetable. [1] [2]LinkedIn CSV Import Improvements:
groupcolumn. Now imports fromlinkedin.csvinstead oflinkedin_sample.csv.Queue Data Retrieval Enhancements:
collectionsandgroupspresent in the queue.Error Handling:
make_metaformat. [1] [2]Other:
app/api/queue/__init__.pyto include the new endpoints.queue_output.txtshowing the new data structure, including the newgroupcolumn.