[ 
https://issues.apache.org/jira/browse/BEAM-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16181693#comment-16181693
 ] 

ASF GitHub Bot commented on BEAM-2959:
--------------------------------------

GitHub user lukecwik opened a pull request:

    https://github.com/apache/beam/pull/3904

    [BEAM-2959] Fix proto enums to use "YYY_UNSPECIFIED" as the first declared 
enum.

    Follow this checklist to help us incorporate your contribution quickly and 
easily:
    
     - [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the 
change (usually before you start working on it).  Trivial changes like typos do 
not require a JIRA issue.  Your pull request should address just this issue, 
without pulling in other changes.
     - [ ] Each commit in the pull request should have a meaningful subject 
line and body.
     - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA 
issue.
     - [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
     - [ ] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
     - [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
    
    ---


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lukecwik/incubator-beam fn_api2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/3904.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3904
    
----
commit a0c55c8e52af83cf1c7fdb98bb862387f791f0a9
Author: Luke Cwik <[email protected]>
Date:   2017-09-15T18:23:19Z

    [BEAM-2959] Fix proto enums to use "YYY_UNSPECIFIED" as the first declared 
enum.

----


> Fix proto enums to not use 0 for a valid value
> ----------------------------------------------
>
>                 Key: BEAM-2959
>                 URL: https://issues.apache.org/jira/browse/BEAM-2959
>             Project: Beam
>          Issue Type: Bug
>          Components: beam-model
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>
> Proto3 uses 0 as the default value for enums and does not encode it on the 
> wire which means that you can not detect the difference between a value that 
> is unset and an enum that is set but has a value of zero.
> Defining an "YYY_UNSPECIFIED" is considered a best practice. Unfortunately 
> this is not done automatically because of proto2 compatibility within proto3.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to