[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=330021=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-330021 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 17/Oct/19 17:27 Start Date: 17/Oct/19 17:27 Worklog Time Spent: 10m Work Description: robertwb commented on pull request #9809: [BEAM-8355] Add standard bool coder to Go SDK URL: https://github.com/apache/beam/pull/9809 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 330021) Time Spent: 4h 10m (was: 4h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Fix For: 2.17.0 > > Time Spent: 4h 10m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=330020=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-330020 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 17/Oct/19 17:27 Start Date: 17/Oct/19 17:27 Worklog Time Spent: 10m Work Description: robertwb commented on issue #9809: [BEAM-8355] Add standard bool coder to Go SDK URL: https://github.com/apache/beam/pull/9809#issuecomment-543278921 Looks fine to me too. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 330020) Time Spent: 4h (was: 3h 50m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Fix For: 2.17.0 > > Time Spent: 4h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=329255=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-329255 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 16/Oct/19 16:53 Start Date: 16/Oct/19 16:53 Worklog Time Spent: 10m Work Description: lostluck commented on issue #9809: [BEAM-8355] Add standard bool coder to Go SDK URL: https://github.com/apache/beam/pull/9809#issuecomment-542794290 R: @mxm R: @chadrik R: @TheNeuralBit R: @robertwb This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 329255) Time Spent: 3h 50m (was: 3h 40m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Fix For: 2.17.0 > > Time Spent: 3h 50m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=329254=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-329254 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 16/Oct/19 16:51 Start Date: 16/Oct/19 16:51 Worklog Time Spent: 10m Work Description: lostluck commented on pull request #9809: [BEAM-8355] Add standard bool coder to Go SDK URL: https://github.com/apache/beam/pull/9809 Adds encoding and decoding for the standard bool coder to the Go SDK. Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`). - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). Post-Commit Tests Status (on master branch) Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark --- | --- | --- | --- | --- | --- | --- | --- Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/) Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/) Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)[![Build
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325606=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325606 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 09:47 Start Date: 09/Oct/19 09:47 Worklog Time Spent: 10m Work Description: mxm commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325606) Time Spent: 3.5h (was: 3h 20m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Fix For: 2.17.0 > > Time Spent: 3.5h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325584=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325584 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 08:33 Start Date: 09/Oct/19 08:33 Worklog Time Spent: 10m Work Description: mxm commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539898087 Run JavaPortabilityApi PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325584) Time Spent: 3h 10m (was: 3h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 3h 10m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325585=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325585 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 08:33 Start Date: 09/Oct/19 08:33 Worklog Time Spent: 10m Work Description: mxm commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539898128 Run Python2_PVR_Flink PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325585) Time Spent: 3h 20m (was: 3h 10m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 3h 20m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325446=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325446 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 02:29 Start Date: 09/Oct/19 02:29 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539793694 Run Java PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325446) Time Spent: 3h (was: 2h 50m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 3h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325445=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325445 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 02:27 Start Date: 09/Oct/19 02:27 Worklog Time Spent: 10m Work Description: kennknowles commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539793241 Please file bugs for Jenkins flakes. You can often find an existing flake by searching JIRA for the job name. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325445) Time Spent: 2h 50m (was: 2h 40m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 2h 50m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325397=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325397 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 00:11 Start Date: 09/Oct/19 00:11 Worklog Time Spent: 10m Work Description: chadrik commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539756148 This should be all ready to merge. The jenkins jobs are being super flaky. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325397) Time Spent: 2h 40m (was: 2.5h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 2h 40m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325392=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325392 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 00:08 Start Date: 09/Oct/19 00:08 Worklog Time Spent: 10m Work Description: chadrik commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539755537 Run Java PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325392) Time Spent: 2.5h (was: 2h 20m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 2.5h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325391=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325391 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 09/Oct/19 00:08 Start Date: 09/Oct/19 00:08 Worklog Time Spent: 10m Work Description: chadrik commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539755521 Run Python PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325391) Time Spent: 2h 20m (was: 2h 10m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 2h 20m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=325269=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-325269 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 08/Oct/19 18:30 Start Date: 08/Oct/19 18:30 Worklog Time Spent: 10m Work Description: robertwb commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-539643431 Thanks. This looks good to me. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 325269) Time Spent: 2h 10m (was: 2h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 2h 10m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324656=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324656 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 07/Oct/19 22:04 Start Date: 07/Oct/19 22:04 Worklog Time Spent: 10m Work Description: robertwb commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r332258190 ## File path: sdks/python/apache_beam/coders/coder_impl.py ## @@ -446,6 +446,28 @@ def decode(self, encoded): return encoded +class BooleanCoderImpl(CoderImpl): + """For internal use only; no backwards-compatibility guarantees. + + A coder for bool objects.""" + + def encode_to_stream(self, value, out, nested): +out.write_byte(1 if value else 0) + + def decode_from_stream(self, in_stream, nested): +return in_stream.read_byte() == 1 Review comment: It'd be forward compatible to fix Java as nothing should be written with these higher values. Let's either do that or reject anything outside of {0, 1}. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324656) Time Spent: 1h 50m (was: 1h 40m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 1h 50m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324618=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324618 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 07/Oct/19 21:22 Start Date: 07/Oct/19 21:22 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r332243001 ## File path: sdks/python/apache_beam/coders/coder_impl.py ## @@ -446,6 +446,28 @@ def decode(self, encoded): return encoded +class BooleanCoderImpl(CoderImpl): + """For internal use only; no backwards-compatibility guarantees. + + A coder for bool objects.""" + + def encode_to_stream(self, value, out, nested): +out.write_byte(1 if value else 0) + + def decode_from_stream(self, in_stream, nested): +return in_stream.read_byte() == 1 Review comment: I follow your logic. e.g. it makes more sense for `0x03` to be `True` than to be `False`. That said, I'm just reproducing the behavior of the Java BooleanCoder: ```java @Override public void encode(Boolean value, OutputStream os) throws IOException { BYTE_CODER.encode(value ? (byte) 1 : 0, os); } @Override public Boolean decode(InputStream is) throws IOException { return BYTE_CODER.decode(is) == 1; } ``` So I think that changing the behavior of the BooleanCoder is outside of the scope of this PR. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324618) Time Spent: 1h 40m (was: 1.5h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324504=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324504 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 07/Oct/19 17:13 Start Date: 07/Oct/19 17:13 Worklog Time Spent: 10m Work Description: robertwb commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r332136104 ## File path: sdks/python/apache_beam/coders/coder_impl.py ## @@ -446,6 +446,28 @@ def decode(self, encoded): return encoded +class BooleanCoderImpl(CoderImpl): + """For internal use only; no backwards-compatibility guarantees. + + A coder for bool objects.""" + + def encode_to_stream(self, value, out, nested): +out.write_byte(1 if value else 0) + + def decode_from_stream(self, in_stream, nested): +return in_stream.read_byte() == 1 Review comment: There's a question here of what to do if we encounter something other than `0x00` or `0x01`. We could either (1) raise an error, (2) interpret as True, or (3) interpret as False. I could go with either (1) or (2) but i think we should definitely avoid (3). This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324504) Time Spent: 1.5h (was: 1h 20m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324222=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324222 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 07/Oct/19 08:33 Start Date: 07/Oct/19 08:33 Worklog Time Spent: 10m Work Description: mxm commented on issue #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#issuecomment-538895201 Run Java PreCommit This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324222) Time Spent: 1h 20m (was: 1h 10m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324109=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324109 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 06/Oct/19 21:39 Start Date: 06/Oct/19 21:39 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r331812002 ## File path: sdks/python/apache_beam/coders/coders.py ## @@ -420,6 +423,31 @@ def __hash__(self): Coder.register_structured_urn(common_urns.coders.BYTES.urn, BytesCoder) +class BooleanCoder(FastCoder): + def _create_impl(self): +return coder_impl.BooleanCoderImpl() + + def is_deterministic(self): +return True + + def to_type_hint(self): +return bool + + def as_cloud_object(self, coders_context=None): +return { +'@type': 'kind:bool', +} Review comment: Ok, so I should delete this before it gets merged? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324109) Time Spent: 1h (was: 50m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324090=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324090 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 06/Oct/19 20:15 Start Date: 06/Oct/19 20:15 Worklog Time Spent: 10m Work Description: kennknowles commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r331808080 ## File path: sdks/python/apache_beam/coders/coders.py ## @@ -420,6 +423,31 @@ def __hash__(self): Coder.register_structured_urn(common_urns.coders.BYTES.urn, BytesCoder) +class BooleanCoder(FastCoder): + def _create_impl(self): +return coder_impl.BooleanCoderImpl() + + def is_deterministic(self): +return True + + def to_type_hint(self): +return bool + + def as_cloud_object(self, coders_context=None): +return { +'@type': 'kind:bool', +} Review comment: You shouldn't have to change as_cloud_object. That method is a Dataflow-specific thing hacked into the coders. Since Dataflow doesn't need to understand it, there's no need for anything custom. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324090) Time Spent: 40m (was: 0.5h) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=324065=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324065 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 06/Oct/19 18:13 Start Date: 06/Oct/19 18:13 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735#discussion_r331802671 ## File path: sdks/python/apache_beam/coders/coders.py ## @@ -420,6 +423,31 @@ def __hash__(self): Coder.register_structured_urn(common_urns.coders.BYTES.urn, BytesCoder) +class BooleanCoder(FastCoder): + def _create_impl(self): +return coder_impl.BooleanCoderImpl() + + def is_deterministic(self): +return True + + def to_type_hint(self): +return bool + + def as_cloud_object(self, coders_context=None): +return { +'@type': 'kind:bool', +} Review comment: I'm not sure what this value should be. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 324065) Time Spent: 0.5h (was: 20m) > Make BooleanCoder a standard coder > -- > > Key: BEAM-8355 > URL: https://issues.apache.org/jira/browse/BEAM-8355 > Project: Beam > Issue Type: New Feature > Components: beam-model, sdk-java-core, sdk-py-core >Reporter: Chad Dombrova >Assignee: Chad Dombrova >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > This involves making the current java BooleanCoder a standard coder, and > implementing an equivalent coder in python -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (BEAM-8355) Make BooleanCoder a standard coder
[ https://issues.apache.org/jira/browse/BEAM-8355?focusedWorklogId=323944=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-323944 ] ASF GitHub Bot logged work on BEAM-8355: Author: ASF GitHub Bot Created on: 05/Oct/19 15:18 Start Date: 05/Oct/19 15:18 Worklog Time Spent: 10m Work Description: chadrik commented on pull request #9735: [BEAM-8355] Add a standard boolean coder URL: https://github.com/apache/beam/pull/9735 This involves making the current java BooleanCoder a standard coder, and implementing an equivalent coder in python Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`). - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). Post-Commit Tests Status (on master branch) Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark --- | --- | --- | --- | --- | --- | --- | --- Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/) | --- | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/) Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/) Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)[![Build Status](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)[![Build