[ 
https://issues.apache.org/jira/browse/BEAM-8457?focusedWorklogId=334368&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-334368
 ]

ASF GitHub Bot logged work on BEAM-8457:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Oct/19 20:55
            Start Date: 25/Oct/19 20:55
    Worklog Time Spent: 10m 
      Work Description: KevinGG commented on pull request #9885: [BEAM-8457] 
Label Dataflow jobs from Notebook
URL: https://github.com/apache/beam/pull/9885#discussion_r339235798
 
 

 ##########
 File path: sdks/python/apache_beam/pipeline.py
 ##########
 @@ -396,28 +400,57 @@ def replace_all(self, replacements):
     for override in replacements:
       self._check_replacement(override)
 
-  def run(self, test_runner_api=True):
-    """Runs the pipeline. Returns whatever our runner returns after running."""
-
+  def run(self, test_runner_api=True, runner=None, options=None,
+          interactive=None):
+    """Runs the pipeline. Returns whatever our runner returns after running.
+
+    If another runner instance and options are provided, that runner will
+    execute the pipeline with the given options. If either of them is not set,
+    a ValueError is raised. The usage is similar to directly invoking
+    `runner.run_pipeline(pipeline, options)`.
+    Additionally, an interactive field can be set to override the pipeline's
+    self.interactive field to mark current pipeline as being initiated from an
+    interactive environment.
+    """
+    if interactive:
+      self.interactive = interactive
+    elif (type(self.runner).__module__
+          == 'apache_beam.runners.interactive.interactive_runner' and
+          type(self.runner).__name__ == 'InteractiveRunner'):
 
 Review comment:
   This is the difference from previous 
[PR](https://www.google.com/url?q=https://github.com/apache/beam/pull/9854). 
   All runners are using  "new-style" classes in Python, the 
`type(obj).__module__/__name__` should always work. Please let me know if there 
would be backward incompatible cases. 
   Thanks!
 
----------------------------------------------------------------
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: 334368)
    Time Spent: 3h 20m  (was: 3h 10m)

> Instrument Dataflow jobs that are launched from Notebooks
> ---------------------------------------------------------
>
>                 Key: BEAM-8457
>                 URL: https://issues.apache.org/jira/browse/BEAM-8457
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-py-interactive
>            Reporter: Ning Kang
>            Assignee: Ning Kang
>            Priority: Major
>             Fix For: 2.17.0
>
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Dataflow needs the capability to tell how many Dataflow jobs are launched 
> from the Notebook environment, i.e., the Interactive Runner.
>  # Change the pipeline.run() API to allow supply a runner and an option 
> parameter so that a pipeline initially bundled w/ an interactive runner can 
> be directly run by other runners from notebook.
>  # Implicitly add the necessary source information through user labels when 
> the user does p.run(runner=DataflowRunner()).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to