-
Notifications
You must be signed in to change notification settings - Fork 134
feat: Support for push config db persistence #164
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
Draft
kthota-g
wants to merge
4
commits into
main
Choose a base branch
from
kthota/push-notifier-sql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
…) (#106) * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * Update check-spelling metadata * feat: postgresql task store * Refactor TaskStore to be database-agnostic using SQLAlchemy This commit replaces the PostgreSQL-specific TaskStore with a generic `DatabaseTaskStore` that leverages SQLAlchemy for database interactions. This change allows your A2A server to support multiple database backends, including SQLite, PostgreSQL, and MySQL. Key changes include: - Definition of a SQLAlchemy model `TaskModel` for storing task data. - Implementation of `DatabaseTaskStore` that uses the `TaskStore` interface and SQLAlchemy for CRUD operations. - Update of example application configurations to use `DatabaseTaskStore` when a `DATABASE_URL` environment variable is provided, defaulting to `InMemoryTaskStore` otherwise. - Creation of parameterized unit tests for `DatabaseTaskStore`, designed to run against SQLite, PostgreSQL, and MySQL to ensure compatibility. - Removal of the old `PostgreSQLTaskStore` and its specific tests. - Addition of necessary dependencies: `sqlalchemy`, `aiosqlite`, `aiomysql`. The new implementation makes the task persistence layer more flexible and extensible, allowing you to choose a database backend that best suits your needs. * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * feat: postgresql task store * Update check-spelling metadata * feat: postgresql task store * Refactor TaskStore to be database-agnostic using SQLAlchemy This commit replaces the PostgreSQL-specific TaskStore with a generic `DatabaseTaskStore` that leverages SQLAlchemy for database interactions. This change allows your A2A server to support multiple database backends, including SQLite, PostgreSQL, and MySQL. Key changes include: - Definition of a SQLAlchemy model `TaskModel` for storing task data. - Implementation of `DatabaseTaskStore` that uses the `TaskStore` interface and SQLAlchemy for CRUD operations. - Update of example application configurations to use `DatabaseTaskStore` when a `DATABASE_URL` environment variable is provided, defaulting to `InMemoryTaskStore` otherwise. - Creation of parameterized unit tests for `DatabaseTaskStore`, designed to run against SQLite, PostgreSQL, and MySQL to ensure compatibility. - Removal of the old `PostgreSQLTaskStore` and its specific tests. - Addition of necessary dependencies: `sqlalchemy`, `aiosqlite`, `aiomysql`. The new implementation makes the task persistence layer more flexible and extensible, allowing you to choose a database backend that best suits your needs. * Refactor project to support multiple database backends This commit introduces optional dependencies for PostgreSQL, MySQL, and SQLite support in the A2A SDK. Key changes include: - Addition of optional dependencies in `pyproject.toml` for database drivers. - Updates to example applications to demonstrate installation and usage with different databases. - Refactoring of task management to utilize a generic `DatabaseTaskStore` for improved flexibility. - Enhancements to the README for clearer instructions on database support. These changes enhance the SDK's versatility, allowing users to choose their preferred database backend. * Add drivername, aiomysql, and DSNs to the list of expected words in the spelling action * GitHub Actions installs SQL dependencies for tests and database tests gracefully skip when SQLAlchemy isn't installed locally * feat(db): refactor database backend to be database-agnostic This allows users to choose their preferred database backend (PostgreSQL, MySQL, SQLite) while maintaining full compatibility and proper type safety. - Replace PostgreSQL-specific JSONB with generic JSON type in models - Implement SQLAlchemy 2.0 best practices with Mapped types and TypeDecorator - Add configurable table name support via create_task_model() factory - Updated metadata field mapping between Pydantic and SQLAlchemy using declared_attr - Add comprehensive tests for metadata field mapping including complex nested data - Update GitHub Actions to install SQL dependencies for tests - Add pytest.importorskip to gracefully skip database tests when SQLAlchemy not installed - Fix test_types.py to use 'id' instead of 'taskId' for JSON-RPC requests - Add automatic cleanup of SQLite file::memory: files after tests - Remove examples directory (moved to separate a2a-samples repo) - Update pyproject.toml to remove workspace members reference and add `nox` for testing * fix(models): correct variable name in TaskModel repr template * fix: use typing_extensions for override decorator for Python 3.10 compatibility The override decorator was added in Python 3.12. For compatibility with Python 3.10, we import it from typing_extensions when not available in the typing module. --------- Co-authored-by: MEUNIER Laurent <[email protected]> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Zac <[email protected]> Co-authored-by: kthota-g <[email protected]>
1 task
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.
[WIP] support for DB backed stores