[ https://issues.apache.org/jira/browse/BEAM-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15839025#comment-15839025 ]
ASF GitHub Bot commented on BEAM-1319: -------------------------------------- GitHub user aaltay opened a pull request: https://github.com/apache/beam/pull/1848 [BEAM-1319] Add conflict resolution to the PipelineOptions internal argparse. In some instances where a PipelineOptions subclass was defined in the main session and save_main_session option is enabled, that subclass may appear multiple times in the PipelineOptions.__subclassess__() list. This is causing problems with the argparse because options are not unique any more. This changes filter the subclasses by name, and pick the last unique instance of each subclass. As an alternative option, we could use the conflict_handler='resolve' of the argparse. However, the drawback of this approach would be that allowing accidental overriding of the same option name in two different PipelineOptions subclasses. Also moves wordcount example to use PipelineOptions. This both serves as an example of using PipelineOptions, also it is already integrated with tests and will continue to test this case. You can merge this pull request into a Git repository by running: $ git pull https://github.com/aaltay/incubator-beam wordo Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/1848.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 #1848 ---- commit b488555304f1110125598dd624077eb94ed0d0d7 Author: Ahmet Altay <al...@google.com> Date: 2017-01-26T01:48:13Z Add conflict resolution to the PipelineOptions internal argparse. In some instances where a PipelineOptions subclass was defined in the main session and save_main_session option is enabled, that subclass may appear multiple times in the PipelineOptions.__subclassess__() list. This is causing problems with the argparse because options are not unique any more. This changes filter the subclasses by name, and pick the last unique instance of each subclass. As an alternative option, we could use the conflict_handler='resolve' of the argparse. However, the drawback of this approach would be that allowing accidental overriding of the same option name in two different PipelineOptions subclasses. Also moves wordcount to use PipelineOptions. This both serves as an example of using PipelineOptions, also it is already integrated with tests and will continue to test this case. ---- > PipelineOptions subclasses defined in the main session could be duplicated > -------------------------------------------------------------------------- > > Key: BEAM-1319 > URL: https://issues.apache.org/jira/browse/BEAM-1319 > Project: Beam > Issue Type: Bug > Components: sdk-py > Reporter: Ahmet Altay > > Duplication is caused as a result of the save_main_session option. > This also breaks argparse because same options will be defined multiple times. -- This message was sent by Atlassian JIRA (v6.3.4#6332)