[ https://issues.apache.org/jira/browse/BEAM-5442?focusedWorklogId=146591&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-146591 ]
ASF GitHub Bot logged work on BEAM-5442: ---------------------------------------- Author: ASF GitHub Bot Created on: 21/Sep/18 20:57 Start Date: 21/Sep/18 20:57 Worklog Time Spent: 10m Work Description: mxm closed pull request #6447: [BEAM-5442] Add FlinkOptions to Python SDK URL: https://github.com/apache/beam/pull/6447 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/sdks/python/apache_beam/options/pipeline_options.py b/sdks/python/apache_beam/options/pipeline_options.py index b75ed2ab5c3..c1bb2ed89e9 100644 --- a/sdks/python/apache_beam/options/pipeline_options.py +++ b/sdks/python/apache_beam/options/pipeline_options.py @@ -662,6 +662,24 @@ def _add_argparse_args(cls, parser): 'in the pipeline when running using the Fn API.')) +class FlinkOptions(PipelineOptions): + + @classmethod + def _add_argparse_args(cls, parser): + parser.add_argument('--flink_master', + type=str, + help= + ('Address of the Flink master where the pipeline ' + 'should be executed. Can either be of the form ' + '\'host:port\' or one of the special values ' + '[local], [collection], or [auto].')) + parser.add_argument('--parallelism', + type=int, + help= + ('The degree of parallelism to be used when ' + 'distributing operations onto workers.')) + + class TestOptions(PipelineOptions): @classmethod diff --git a/sdks/python/apache_beam/options/pipeline_options_test.py b/sdks/python/apache_beam/options/pipeline_options_test.py index 55e8ee88daf..9c14c25668e 100644 --- a/sdks/python/apache_beam/options/pipeline_options_test.py +++ b/sdks/python/apache_beam/options/pipeline_options_test.py @@ -104,6 +104,16 @@ def tearDown(self): 'display_data': [ DisplayDataItemMatcher('mock_multi_option', ['op1', 'op2'])] }, + {'flags': ['--flink_master=testmaster:8081', '--parallelism=42'], + 'expected': {'flink_master': 'testmaster:8081', + 'parallelism': 42, + 'mock_flag': False, + 'mock_option': None, + 'mock_multi_option': None}, + 'display_data': [ + DisplayDataItemMatcher('flink_master', 'testmaster:8081'), + DisplayDataItemMatcher('parallelism', 42)] + }, ] # Used for testing newly added flags. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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: 146591) Time Spent: 2h 50m (was: 2h 40m) > PortableRunner swallows custom options for Runner > ------------------------------------------------- > > Key: BEAM-5442 > URL: https://issues.apache.org/jira/browse/BEAM-5442 > Project: Beam > Issue Type: Bug > Components: sdk-java-core, sdk-py-core > Reporter: Maximilian Michels > Assignee: Maximilian Michels > Priority: Major > Labels: portability, portability-flink > Fix For: 2.8.0 > > Time Spent: 2h 50m > Remaining Estimate: 0h > > The PortableRunner doesn't pass custom PipelineOptions to the executing > Runner. > Example: {{--parallelism=4}} won't be forwarded to the FlinkRunner. > (The option is just removed during proto translation without any warning) > We should allow some form of customization through the options, even for the > PortableRunner. -- This message was sent by Atlassian JIRA (v7.6.3#76005)