Jie Luo
c301c2ca28
Breaking Change: Remove deprecated UseDeprecatedLegacyJsonFieldConflicts()
...
https://protobuf.dev/news/2025-09-19/#cpp-remove-apis
PiperOrigin-RevId: 853477445
2026-01-07 17:35:56 -08:00
Mikita Belahlazau
4f076d951f
Add metadata annotations for generated Python protobuf symbols.
...
The pyi generator now includes Kythe annotations for:
* Extension field constants (e.g., `EXTENSION_FIELD`).
* Field number constants (e.g., `STRING_FIELD_FIELD_NUMBER`).
* `Create` methods in generated Stubby client classes.
These annotations allow the Python indexer to link these generated symbols back to their definitions in the `.proto` files.
PiperOrigin-RevId: 852971617
2026-01-06 16:05:56 -08:00
Protobuf Team Bot
ae67a4c195
Internal version update.
...
PiperOrigin-RevId: 852733884
2026-01-06 05:27:44 -08:00
Chris Kennelly
a70115f33f
Breaking change: Add [[nodiscard]] to many APIs.
...
This covers two types of failures:
* Methods that are logically const and failure to consume the result indicates a bug
(an unnecessary call, etc.)
* Methods that return significant errors (failure to parse, etc.) that should not be
unintentionally ignored.
PiperOrigin-RevId: 852313694
2026-01-05 08:41:35 -08:00
Rachel Goldfinger
0404e66d8b
Add conformance test for edition unstable
...
PiperOrigin-RevId: 850054867
2025-12-29 07:41:37 -08:00
Mike Kruskal
232f409e96
Avoid PyObject_CallMethod with pending errors, which always asserts.
...
This can happen from ignored errors during build (e.g. missing option dependencies).
PiperOrigin-RevId: 847929958
2025-12-22 17:10:01 -08:00
Protobuf Team Bot
4f74970c83
Automated Code Change
...
PiperOrigin-RevId: 846019877
2025-12-17 19:38:00 -08:00
Jie Luo
b76faa921f
Breaking Change: Remove deprecated FieldDescriptor::label() in OSS. Use is_repeated() or is_required() instead
...
https://protobuf.dev/news/2025-09-19/#cpp-remove-apis
PiperOrigin-RevId: 845462045
2025-12-16 15:43:37 -08:00
Protobuf Team Bot
c4fb46840a
Automated Code Change
...
PiperOrigin-RevId: 845123384
2025-12-16 00:29:08 -08:00
Protobuf Team Bot
60f0834f1c
Fixed case of referencing invalid pointer.
...
When running __new__ MessageMeta, the cache access can crash because it's missing a validation on the object it is given.
PiperOrigin-RevId: 844820889
2025-12-15 10:14:13 -08:00
Chris Kennelly
d326c1d6da
Prepare to make many APIs [[nodiscard]].
...
PiperOrigin-RevId: 844770264
2025-12-15 07:53:39 -08:00
Protobuf Team Bot
4459a20205
Support more chars in type URLs in the Python text-format parser.
...
Change the Python text-format parser to allow for more characters and formats
in the type URL prefixes of expanded Any protos. This follows a recent
change to the text-format spec which we are now closely following.
Refs:
- [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters
- [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-
PiperOrigin-RevId: 844614988
2025-12-14 23:31:47 -08:00
Jie Luo
5b116fe2f1
Breaking change: Raise errors in OSS when assign bool to int/enum field in Python Proto.
...
https://protobuf.dev/news/2025-09-19/#python-reject-bool-enum-int
PiperOrigin-RevId: 843305319
2025-12-11 11:28:56 -08:00
Jie Luo
e4854a186e
Breaking change: Remove float_format/double_format from python proto text_format
...
https://protobuf.dev/news/2025-09-19/#python-remove-text-format-options
PiperOrigin-RevId: 842814167
2025-12-10 11:45:33 -08:00
Protobuf Team Bot
59f2a6e145
Two new functions in PyProto_API to manage DescriptorPools
...
`DescriptorPool_FromPool` has a new overload that takes ownership of the C++ instance.
`DescriptorPool_AsPool` returns the C++ instance held by the Python object.
PiperOrigin-RevId: 842651360
2025-12-10 03:52:15 -08:00
Protobuf Team Bot
c50fb166d9
Automated rollback of commit d170d28b0d.
...
PiperOrigin-RevId: 842620254
2025-12-10 02:09:10 -08:00
Chris Kennelly
d170d28b0d
Add [[nodiscard]] to many APIs.
...
This covers two types of failures:
* Methods that are logically const and failure to consume the result indicates a bug
(an unnecessary call, etc.)
* Methods that return significant errors (failure to parse, etc.) that should not be
unintentionally ignored.
PiperOrigin-RevId: 842042770
2025-12-08 21:06:53 -08:00
Protobuf Team Bot
54a48aa45c
Add tests for the C++ PyProto_API interface
...
PiperOrigin-RevId: 841620471
2025-12-07 23:59:35 -08:00
Jie Luo
0a8ff55518
Breaking change: Remove deprecated FieldDescriptor.label
...
https://protobuf.dev/news/2025-09-19/#python-remove-apis
PiperOrigin-RevId: 836922631
2025-11-25 21:02:16 -08:00
Jie Luo
1eb4e5290a
Python Proto scalar repeated numpy binding.
...
Add __array__ magic method to scalar repeated field. The default returned dtype of numpy/tensorflow usages like np.arrary() np.asarray() will be change.
Cpp_Type | np.array() dtype | Old tf.reshape() dtype | New dtype
float. | float64/float64 | float32/float32. | float32
double. | float64/float64. | float32/float32. | float64
int32. | int64/float64. | int32/float32. | int32
int64. | int64/float64. | int32/float32. | int64
uint32. | int64/float64. | int32/float32. | uint32
uint64. | int64/float64. | int32/float32. | uint64
bool. | bool/float64. | bool/float32. | bool
enum | int64/float64 | int32/float32 | int32
string | U/float64 | string/float32 | U (Unicode string)
bytes | S/float64 | string/float32. | S (Byte string)
Performance improvement:
For non-string repeated:
-upb/cpp are about 50-100 times faster.
-pure python is ~3x times faster.
For string repeated: numbers are noise, no regression (maybe a slight win)
PiperOrigin-RevId: 836264273
2025-11-24 09:59:08 -08:00
Jie Luo
b8bef14b3c
Python Proto Free Threading tests/experimental
...
Add experimental and simple tests for free threading support on python fast cpp.
PiperOrigin-RevId: 835343204
2025-11-21 13:41:46 -08:00
Protobuf Team Bot
dc563204b9
Automated rollback of commit 4af0b887a5.
...
PiperOrigin-RevId: 832431649
2025-11-14 13:18:18 -08:00
Protobuf Team Bot
4af0b887a5
Automated rollback of commit c13d266bbd.
...
PiperOrigin-RevId: 832430921
2025-11-14 13:14:00 -08:00
Mike Kruskal
c13d266bbd
Automated rollback of commit 7ebcd88e66.
...
PiperOrigin-RevId: 832379983
2025-11-14 10:59:28 -08:00
Protobuf Team Bot
7ebcd88e66
Automated rollback of commit 6d93331d94.
...
PiperOrigin-RevId: 831632187
2025-11-12 18:59:12 -08:00
Mike Kruskal
6d93331d94
Fix extension count calculation for dynamic messages in Python/C++
...
PiperOrigin-RevId: 831594895
2025-11-12 17:04:36 -08:00
Jie Luo
8e3543177e
Add Python 3.14 test coverage
...
#test-continuous
PiperOrigin-RevId: 829211258
2025-11-06 19:21:19 -08:00
Protobuf Team Bot
5ca478eeee
Automated Code Change
...
PiperOrigin-RevId: 828764044
2025-11-05 21:01:29 -08:00
Michael Voznesensky
e2ddebe709
Put ABSL annotations back in descriptor
...
(was failing builds with certain thread safety flags set)
PiperOrigin-RevId: 826886077
2025-11-01 09:33:35 -07:00
Michael Voznesensky
13fe37f25f
Free threading compat - Only access interned_descriptors behind a mutex
...
#test-continuous
PiperOrigin-RevId: 826560040
2025-10-31 11:20:34 -07:00
Jie Luo
f027f1fcd5
Breaking change: Remove float_precision from python proto json_format
...
PiperOrigin-RevId: 826158770
2025-10-30 13:20:37 -07:00
Protobuf Team Bot
50bd022669
Move descriptor pool containers to flat_hash_map to speed it up.
...
PiperOrigin-RevId: 826110301
2025-10-30 11:17:16 -07:00
Protobuf Team Bot
fce097b797
Automated Code Change
...
PiperOrigin-RevId: 825932490
2025-10-30 02:13:27 -07:00
Protobuf Team Bot
8d1a952451
Automated Code Change
...
PiperOrigin-RevId: 825929025
2025-10-30 02:02:53 -07:00
Peter Hawkins
2e7ac71b88
Tag the api_implementation Python extension module as Python 3.13 no-GIL compatible.
...
This module has no global state, so concurrency should be fine.
PiperOrigin-RevId: 825299491
2025-10-28 18:48:41 -07:00
Protobuf Team Bot
3f6f8cca0c
Protect internal descriptors map with a global lock.
...
Detailed description...
Fix multi-thread access to internal descriptors map and change the container type from unordered_map to flat_hash_map to gain a bit more speed.
PiperOrigin-RevId: 825235142
2025-10-28 15:41:54 -07:00
Jie Luo
00aaca1b4d
Breaking change: raise TypeError when convert non-timedelta to Duration, or convert non-datetime to Timestamp in python proto. (Original code may raise ArributeError)
...
https://protobuf.dev/news/2025-09-19/#python-type-error-timestamp-duration
PiperOrigin-RevId: 824803296
2025-10-27 20:22:37 -07:00
Jie Luo
772aed30ca
Fix python 3.13 reference check failures.
...
GC untrack descriptors, pool and factory before destruct the pyobject.
PiperOrigin-RevId: 824292939
2025-10-26 18:01:33 -07:00
Protobuf Team Bot
a2b034a9b1
Update to use the forward-looking proper noun "ProtoJSON" to refer to the format which was formerly known as "Proto3 JSON"
...
PiperOrigin-RevId: 823566944
2025-10-24 09:54:02 -07:00
Hong Shin
547ae49491
internal change
...
PiperOrigin-RevId: 823205194
2025-10-23 15:13:55 -07:00
Protobuf Team Bot
412d0a2f07
Python: kwargs initialization would silently swallow some errors with repeated fields.
...
PiperOrigin-RevId: 822027476
2025-10-21 02:55:21 -07:00
Protobuf Team Bot
79ab761999
Fix: Use data() instead of c_str() for StringViewArg.
...
PiperOrigin-RevId: 820483131
2025-10-16 19:14:35 -07:00
Jie Luo
26d08d51b9
Fix Python cpp memory crash when MergeFrom Oneof.
...
Maybe release oneof messages before MergeFrom in python cpp extension
PiperOrigin-RevId: 819802492
2025-10-15 10:09:16 -07:00
Clayton Knittel
be2d06dd93
Pass arenas down to map methods, and avoid accessing arena_ directly in map field implementation.
...
Note that we can't change any public-facing API's that need an arena pointer, as this would be a breaking change. Additionally, assignment operators need the arena pointer, but can't take additional arguments.
This is in preparation for removing the arena_ member from maps.
PiperOrigin-RevId: 818979467
2025-10-13 21:20:18 -07:00
Hong Shin
3f7cfffb44
internal change
...
PiperOrigin-RevId: 817314491
2025-10-09 13:31:52 -07:00
honglooker
6d00d87830
Updating version.json and repo version numbers to: 34.0-dev ( #23738 )
...
NOTE: This should be reviewed and imported via Copybara per the normal PR review process.
Closes #23738
PiperOrigin-RevId: 814297739
2025-10-02 10:51:16 -07:00
Protobuf Team Bot
f00f665292
Fix potential null-termination issue in FindFileContainingSymbol.
...
Replace `c_str()` with `data()` when calling `PyObject_CallMethod` and `PyObject_CallFunction` to avoid potential issues.
PiperOrigin-RevId: 812768308
2025-09-29 07:00:48 -07:00
Jie Luo
5f6c0139a7
Add construction support for repeated Timestamp/Duration/Struct/ListValue.
...
-Users can now assign list datetime/temedelta to repeated Timestamp/Duration in construction.
-Can assign list dictionary to repeated Struct.
-Can assign list of list to repeated ListValue.
https://github.com/protocolbuffers/protobuf/issues/21541
PiperOrigin-RevId: 804523563
2025-09-08 11:47:20 -07:00
Protobuf Team Bot
07ef6769c6
Fix handling of repeated extension fields in PyProto JSON
...
Both serialize and parse path would not work on repeated extensions before these fixes.
https://github.com/protocolbuffers/protobuf/issues/22989
PiperOrigin-RevId: 803542611
2025-09-05 11:46:02 -07:00
Mike Kruskal
65e1331d74
Add python tests for import option
...
PiperOrigin-RevId: 802323611
2025-09-02 16:20:53 -07:00