fix: use MySQL compatible syntax in list tasks - #651
Merged
Merged
Conversation
Contributor
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
ishymko
force-pushed
the
ishymko/1.0-tests
branch
from
January 30, 2026 15:20
7722cb7 to
d5818e5
Compare
ishymko
force-pushed
the
ishymko/1.0-tests
branch
from
January 30, 2026 15:24
3c7bbcd to
4d90a44
Compare
1 task
Based on [`unit-tests.yml`](https://github.com/a2aproject/a2a-python/blob/main/.github/workflows/unit-tests.yml). Supports: - `--debug` to start DB(s) without running tests (for selective running in IDE) - `--mysql`, `--postgres` to use only one DB - `--stop` to stop after running with `--debug` From project root: ```bash ./scripts/run_integration_tests.sh ``` Re #652 to troubleshoot failures
ishymko
force-pushed
the
ishymko/1.0-tests
branch
from
February 2, 2026 07:56
4d90a44 to
5ebeb51
Compare
This reverts commit 9dad851127995fb92860febef7deadc0ad79e294.
ishymko
force-pushed
the
ishymko/1.0-tests
branch
from
February 2, 2026 07:58
5ebeb51 to
4a1e918
Compare
ishymko
marked this pull request as ready for review
February 2, 2026 08:04
guglielmo-san
approved these changes
Feb 2, 2026
ishymko
added a commit
that referenced
this pull request
Feb 13, 2026
# Description Do not use `NULLS LAST` which is not available in MySQL, coalesce nulls to empty strings which will appear last in descending ordering (there are tests for this behavior already, however CI wasn't enabled for this branch). Currently `NULLS LAST` fails MySQL tests: ``` (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULLS LAST, tasks.id DESC \n LIMIT 51' at line 3") ``` ([actions run](https://github.com/a2aproject/a2a-python/actions/runs/21520017047/job/62008309612?pr=651)) Enable tests run against `1.0-dev` to prevent it in the future. Re #511 Fixes #652 --- Mark as "refactor" for release please as it's a fix for a non-released feature, hence shouldn't get into a changelog. BEGIN_COMMIT_OVERRIDE refactor: use MySQL compatible syntax in list tasks END_COMMIT_OVERRIDE
1 task
5 tasks
mykytanetipa
added a commit
that referenced
this pull request
Sep 10, 2026
# Description `DatabaseTaskStore.list()` currently makes NULL timestamps sort last by coalescing them to `datetime.min` (year 0001). MySQL documents year 1000 as the lower bound of its supported `DATETIME` range. Current MySQL versions may still accept year 0001, so this is a portability and specification-conformance risk rather than a consistently reproducible runtime failure. This change replaces the datetime sentinel with an explicit ordering key: 1. a `CASE` expression ranks non-NULL timestamps before NULL timestamps; 2. non-NULL timestamps remain in descending order; and 3. task IDs remain the descending tie-breaker, including for NULL timestamps. This preserves the existing list and cursor-pagination order without binding an out-of-range datetime. It also avoids `NULLS LAST`, which MySQL does not support and which was previously removed in #651. The regression test observes SQLAlchemy's compiled execution parameters and fails if `list()` binds a datetime before year 1000. With the test applied to the base implementation, the SQLite case failed by capturing the year-0001 sentinel. With this change, the same test passes on SQLite, PostgreSQL 15, and MySQL 8.0, alongside the existing ordering and pagination matrix. ## Validation - `./scripts/lint.sh` — Ruff check/format passed; `ty check` passed - `./scripts/run_db_tests.sh -k test_list_tasks` — 36 passed across SQLite, PostgreSQL 15, and MySQL 8.0 - `uv run pytest tests/integration/cross_version/client_server/test_client_server.py -q` — 4 passed - `uv run pytest` — 1971 passed, 92 skipped, 3 xfailed, 1 xpassed - `uv run pytest --cov=src --cov-report=term-missing` — same test result, 93% total coverage - `git diff --check` — passed ## Checklist - [x] Followed the `CONTRIBUTING` guide and repository AI workflow documents. - [x] Used a Conventional Commit title. - [x] Ran the required linter, formatter, type checker, full tests, and coverage. - [x] Added a regression test for the changed runtime behavior. - [x] No user-facing documentation change is required; ordering semantics are unchanged. Fixes #1219 🦕 AI assistance was used for issue and code-path research and for drafting. I reviewed the final diff and ran every validation command listed above. Co-authored-by: mykytanetipa <[email protected]>
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.
Description
Do not use
NULLS LASTwhich is not available in MySQL, coalesce nulls to empty strings which will appear last in descending ordering (there are tests for this behavior already, however CI wasn't enabled for this branch).Currently
NULLS LASTfails MySQL tests:(actions run)
Enable tests run against
1.0-devto prevent it in the future.Re #511
Fixes #652
Mark as "refactor" for release please as it's a fix for a non-released feature, hence shouldn't get into a changelog.
BEGIN_COMMIT_OVERRIDE
refactor: use MySQL compatible syntax in list tasks
END_COMMIT_OVERRIDE