feat: add optional methods for schedule sources#21
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds optional methods for schedule sources to enable runtime schedule management. The key changes include adding add_schedule, delete_schedule, and post_send methods to schedule source implementations, refactoring shared code to the base class, and improving SQL query safety.
Key changes:
- Added
add_scheduleanddelete_schedulemethods to all schedule source implementations - Moved duplicated schedule extraction logic from individual implementations to base class
- Enhanced SQL security using parameterized queries with proper identifier handling
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/taskiq_pg/_internal/schedule_source.py | Added shared extract_scheduled_tasks_from_broker method to base class |
| src/taskiq_pg/psycopg/schedule_source.py | Implemented add/delete/post_send methods with SQL injection protection |
| src/taskiq_pg/psqlpy/schedule_source.py | Implemented add/delete/post_send methods |
| src/taskiq_pg/asyncpg/schedule_source.py | Implemented add/delete/post_send methods |
| src/taskiq_pg/aiopg/schedule_source.py | Implemented add/delete/post_send methods |
| src/taskiq_pg/*/queries.py | Added DELETE_SCHEDULE_QUERY constant |
| tests/integration/test_schedule_source.py | Added integration tests for new schedule management methods |
| docs/tutorial/schedule_source.md | Added documentation for runtime schedule management |
| pyproject.toml | Added polyfactory test dependency and enabled pydocstyle |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
c8105cc to
91ce7de
Compare
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.
No description provided.