Ruby oneofs: return default instead of nil for unset fields.#1558
Merged
haberman merged 2 commits intoprotocolbuffers:masterfrom May 19, 2016
Merged
Ruby oneofs: return default instead of nil for unset fields.#1558haberman merged 2 commits intoprotocolbuffers:masterfrom
haberman merged 2 commits intoprotocolbuffers:masterfrom
Conversation
Member
Author
|
Review to @acozzette. This is part of a general decision that oneof fields should return defaults when unset instead of nil. |
ruby/ext/google/protobuf_c/storage.c
Outdated
| } | ||
| } | ||
|
|
||
| VALUE value_from_default(const upb_fielddef *field) { |
There was a problem hiding this comment.
Should this function be static since it is only called from within this file?
|
LGTM |
Member
Author
|
I addressed your comment and also fixed JRuby. The enum behavior was slightly wrong also, so I've fixed that too. PTAL. |
|
LGTM |
Contributor
|
Is this the desired behavior for all languages? Because the JavaScript implementation does currently suffer from the same ailment: unset oneof fields return |
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 5, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 621873066
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 5, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 621873066
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 5, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 621873066
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 5, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 621873066
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 10, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 621873066
copybara-service bot
pushed a commit
that referenced
this pull request
Apr 10, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (#832) PiperOrigin-RevId: 623401031
deannagarcia
pushed a commit
to deannagarcia/protobuf
that referenced
this pull request
Jun 20, 2024
https://github.com/bazelbuild/rules_python/blob/main/python/private/proto/py_proto_library.bzl Contributors: d96214f tpudlik@google.com Wed Nov 15 02:48:06 2023 -0800 fix: py_proto_library: transitive strip_import_prefix (protocolbuffers#1558) 85e50d2 tpudlik@gmail.com Tue Nov 14 06:04:59 2023 -0800 fix: py_proto_library: append to PYTHONPATH less (protocolbuffers#1553) bee35ef zplin@uber.com Wed Oct 11 20:59:34 2023 -0700 fix: allowing to import code generated from proto with strip_import_prefix (protocolbuffers#1406) 1a333ce ilist@google.com Tue Jun 20 19:36:39 2023 +0200 fix: plugin_output in py_proto_library rule (protocolbuffers#1280) 6905e63 ignas.anikevicius@woven-planet.global Sat Feb 11 14:02:33 2023 +0900 fix: make py_proto_library respect PyInfo imports (protocolbuffers#1046) 0d3c4f7 ilist@google.com Wed Jan 18 23:15:52 2023 +0000 Implement py_proto_library (protocolbuffers#832) PiperOrigin-RevId: 623401031
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.