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

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

                Author: ASF GitHub Bot
            Created on: 11/Nov/19 18:14
            Start Date: 11/Nov/19 18:14
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #9885: [BEAM-8457] 
Label Dataflow jobs from Notebook
URL: https://github.com/apache/beam/pull/9885#discussion_r344841478
 
 

 ##########
 File path: 
sdks/python/apache_beam/runners/interactive/interactive_environment.py
 ##########
 @@ -93,17 +94,7 @@ def __init__(self, cache_manager=None):
                       'install apache-beam[interactive]` to install necessary '
                       'dependencies to enable all data visualization 
features.')
 
-    self._is_in_ipython = False
-    self._is_in_notebook = False
-    # Check if the runtime is within an interactive environment, i.e., ipython.
-    try:
-      from IPython import get_ipython  # pylint: disable=import-error
-      if get_ipython():
-        self._is_in_ipython = True
-        if 'IPKernelApp' in get_ipython().config:
-          self._is_in_notebook = True
-    except ImportError:
-      pass
+    self._is_in_ipython, self._is_in_notebook = is_interactive()
 
 Review comment:
   Conventionally, `is_xxx` functions return a boolean. Returning a pair will 
be especially surprising if one writes statements like `if is_interactive()` 
and the return value is `(False, False)` (which as a non-zero-length tuple 
evaluates to `True`.
 
----------------------------------------------------------------
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: 341402)
    Time Spent: 9h 20m  (was: 9h 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: 9h 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