[
https://issues.apache.org/jira/browse/BEAM-3713?focusedWorklogId=310829&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-310829
]
ASF GitHub Bot logged work on BEAM-3713:
----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Sep/19 16:56
Start Date: 11/Sep/19 16:56
Worklog Time Spent: 10m
Work Description: tvalentyn commented on pull request #9514: [BEAM-3713]
Convert ITs to not use save_main_session
URL: https://github.com/apache/beam/pull/9514#discussion_r323352376
##########
File path: sdks/python/apache_beam/examples/complete/distribopt.py
##########
@@ -314,7 +314,7 @@ def format_output(element):
return result
-def run(argv=None):
+def run(argv=None, save_main_session=True):
Review comment:
I am not sure adding another parameter is simpler, for example it may create
a question to users such as:
_Why do some parameters to `run()` are passed via parsing argv, and some via
additional parameter, how do we chose which method to use? Oh wait,
`save_main_session` is actually defined as an argument in `SetupOptions`, why
the example does not reuse that option?_
It is not obvious to users that we need this parameter just to make testing
simpler. If you think that adding an extra argument is easier, consider naming
it something like `testing=False` to indicate that this codepath is required
for Beam integration tests.
In my opinion the less parameters users have to reason about, the easier the
example, and I still think this parameter is not necessary, but perhaps the
following would be more reader-friendly:
```
if __name__ == '__main__':
pipeline_options.view_as(SetupOptions).save_main_session = True
```
Feel free to disagree or solicit another opinion. If you still think your
solution is better, consider this review LGTM.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 310829)
Time Spent: 6h 20m (was: 6h 10m)
> Consider moving away from nose to nose2 or pytest.
> --------------------------------------------------
>
> Key: BEAM-3713
> URL: https://issues.apache.org/jira/browse/BEAM-3713
> Project: Beam
> Issue Type: Test
> Components: sdk-py-core, testing
> Reporter: Robert Bradshaw
> Assignee: Udi Meiri
> Priority: Minor
> Time Spent: 6h 20m
> Remaining Estimate: 0h
>
> Per
> [https://nose.readthedocs.io/en/latest/|https://nose.readthedocs.io/en/latest/,]
> , nose is in maintenance mode.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)