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

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

                Author: ASF GitHub Bot
            Created on: 05/Oct/21 00:34
            Start Date: 05/Oct/21 00:34
    Worklog Time Spent: 10m 
      Work Description: KevinGG commented on a change in pull request #15647:
URL: https://github.com/apache/beam/pull/15647#discussion_r721805404



##########
File path: sdks/python/apache_beam/runners/interactive/sql/utils.py
##########
@@ -77,21 +86,23 @@ def find_pcolls(
     if verbose:
       _LOGGER.info('Found PCollections used in the magic: %s.', found)
       _LOGGER.info('Collecting data...')
-    for name, pcoll in found.items():
-      try:
-        _ = ib.collect(pcoll)
-      except (KeyboardInterrupt, SystemExit):
-        raise
-      except:
-        _LOGGER.error(
-            'Cannot collect data for PCollection %s. Please make sure the '
-            'PCollections queried in the sql "%s" are all from a single '
-            'pipeline using an InteractiveRunner. Make sure there is no '
-            'ambiguity, for example, same named PCollections from multiple '
-            'pipelines or notebook re-executions.',
-            name,
-            sql)
-        raise
+    if run:
+      from apache_beam.runners.interactive import interactive_beam as ib
+      for name, pcoll in found.items():
+        try:
+          _ = ib.collect(pcoll)
+        except (KeyboardInterrupt, SystemExit):
+          raise
+        except:
+          _LOGGER.error(
+              'Cannot collect data for PCollection %s. Please make sure the '
+              'PCollections queried in the sql "%s" are all from a single '
+              'pipeline using an InteractiveRunner. Make sure there is no '
+              'ambiguity, for example, same named PCollections from multiple '
+              'pipelines or notebook re-executions.',
+              name,
+              sql)
+          raise

Review comment:
       Agreed. Move it to the main body of the beam_sql magic.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 660009)
    Time Spent: 45h 40m  (was: 45.5h)

> InteractiveRunner cannot execute pipeline with cross-language transform
> -----------------------------------------------------------------------
>
>                 Key: BEAM-10708
>                 URL: https://issues.apache.org/jira/browse/BEAM-10708
>             Project: Beam
>          Issue Type: Bug
>          Components: cross-language
>            Reporter: Brian Hulette
>            Assignee: Ning
>            Priority: P2
>          Time Spent: 45h 40m
>  Remaining Estimate: 0h
>
> The InteractiveRunner crashes when given a pipeline that includes a 
> cross-language transform.
> Here's the example I tried to run in a jupyter notebook:
> {code:python}
> p = beam.Pipeline(InteractiveRunner())
> pc = (p | SqlTransform("""SELECT
>             CAST(1 AS INT) AS `id`,
>             CAST('foo' AS VARCHAR) AS `str`,
>             CAST(3.14  AS DOUBLE) AS `flt`"""))
> df = interactive_beam.collect(pc)
> {code}
> The problem occurs when 
> [pipeline_fragment.py|https://github.com/apache/beam/blob/dce1eb83b8d5137c56ac58568820c24bd8fda526/sdks/python/apache_beam/runners/interactive/pipeline_fragment.py#L66]
>  creates a copy of the pipeline by [writing it to proto and reading it 
> back|https://github.com/apache/beam/blob/dce1eb83b8d5137c56ac58568820c24bd8fda526/sdks/python/apache_beam/runners/interactive/pipeline_fragment.py#L120].
>  Reading it back fails because some of the pipeline is not written in Python.



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

Reply via email to