[
https://issues.apache.org/jira/browse/BEAM-10708?focusedWorklogId=660017&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-660017
]
ASF GitHub Bot logged work on BEAM-10708:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Oct/21 00:43
Start Date: 05/Oct/21 00:43
Worklog Time Spent: 10m
Work Description: KevinGG commented on a change in pull request #15647:
URL: https://github.com/apache/beam/pull/15647#discussion_r721808069
##########
File path: sdks/python/apache_beam/runners/interactive/sql/beam_sql_magics.py
##########
@@ -181,11 +196,22 @@ def beam_sql(self, line: str, cell: Optional[str] = None)
-> Optional[PValue]:
if not query:
on_error('Please supply the SQL query to be executed.')
return
+ if runner and runner not in _SUPPORTED_RUNNERS:
+ on_error(
+ 'Runner "%s" is not supported. Supported runners are %s.',
+ runner,
+ _SUPPORTED_RUNNERS)
query = ' '.join(query)
- found = find_pcolls(query, pcoll_by_name(), verbose=verbose)
+ found = find_pcolls(
+ query,
+ pcoll_by_name(),
+ run=runner in ('DirectRunner', None),
+ verbose=verbose)
+ schemas = set()
+ main_session = importlib.import_module('__main__')
Review comment:
It's used below in a for-loop, put it here to only import it once.
##########
File path: sdks/python/apache_beam/runners/interactive/sql/utils_test.py
##########
@@ -81,5 +73,35 @@ def test_pformat_namedtuple(self):
'ANamedTuple(a: int, b: str)', pformat_namedtuple(ANamedTuple))
[email protected](
+ not ie.current_env().is_interactive_ready,
+ '[interactive] dependency is not installed.')
[email protected](
+ not ie.current_env().is_interactive_ready,
+ reason='[interactive] dependency is not installed.')
+class OptionsFormTest(unittest.TestCase):
+ def test_dataflow_options_form(self):
+ p = beam.Pipeline()
+ pcoll = p | beam.Create([1, 2, 3])
+ with patch('google.auth') as ga:
+ ga.default = lambda: ['', 'default_project_id']
+ df_form = DataflowOptionsForm('pcoll', pcoll)
+ df_form.display_for_input()
+ df_form.entries[2].input.value = 'gs://test-bucket'
+ df_form.entries[3].input.value = 'a-pkg'
+ options = df_form.to_options()
+ self.assertEqual(
+ options.view_as(GoogleCloudOptions).project, 'default_project_id')
+ self.assertEqual(
+ options.view_as(GoogleCloudOptions).region, 'us-central1')
+ self.assertEqual(
+ options.view_as(GoogleCloudOptions).staging_location,
+ 'gs://test-bucket/staging')
+ self.assertEqual(
+ options.view_as(GoogleCloudOptions).temp_location,
+ 'gs://test-bucket/temp')
Review comment:
Acked.
--
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: 660017)
Time Spent: 46h 10m (was: 46h)
> 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: 46h 10m
> 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)