Repository navigation
Commit 654774f
docs(helpers): note that whole numbers in a data Part come back as floats (#1373)
# Description
Whole numbers placed in a data Part come back as floats. For example,
`4326` becomes `4326.0`. This happens because `google.protobuf.Value`
stores every number as a double. It affects every transport and is not a
spec violation, since JSON does not distinguish the two.
As agreed in #1328, this PR documents the behavior and does not change
it.
- Add a short note to the docstrings of `new_data_part` and
`get_data_parts`.
- Add one bullet to the v1.0 migration guide with the client-side
workaround.
- Add a strict xfail test that expects integers to stay integers, so CI
flags it when the behavior changes.
- [x] Follow the [`CONTRIBUTING`
Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md).
- [x] Make your Pull Request title in the
<https://www.conventionalcommits.org/> specification.
- [x] Ensure the tests and linter pass (Run `bash scripts/format.sh`
from the repository root to format)
- [x] Appropriate docs were updated (if necessary)
Refs #1328 🦕
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Mateusz Iwaniuk <45974414+Iwaniukooo11@users.noreply.github.com>1 parent 4b1b587 commit 654774f
3 files changed
Lines changed: 22 additions & 0 deletions
File tree
- docs/migrations/v1_0
- src/a2a/helpers
- tests/helpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
342 | 347 | | |
343 | 348 | | |
344 | 349 | | |
| |||
407 | 412 | | |
408 | 413 | | |
409 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
410 | 420 | | |
411 | 421 | | |
412 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
474 | 485 | | |
475 | 486 | | |
476 | 487 | | |
| |||
0 commit comments