[
https://issues.apache.org/jira/browse/BEAM-7876?focusedWorklogId=286986&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-286986
]
ASF GitHub Bot logged work on BEAM-7876:
----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Aug/19 19:55
Start Date: 01/Aug/19 19:55
Worklog Time Spent: 10m
Work Description: davidyan74 commented on pull request #9220: [BEAM-7876]
Fixed TypeError inside the display manager in the Interactive Runner with
Python 3
URL: https://github.com/apache/beam/pull/9220
create_svg from graphviz returns bytes and need to be converted to string in
order for the interactive runner to work on Python3.
R: @aaltay
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] [**Choose
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and
mention them in a comment (`R: @username`).
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
Java | [](https://builds.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python2/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python35/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/lastCompletedBuild/)
| --- | --- | [](https://builds.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/)
Pre-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
--- |Java | Python | Go | Website
--- | --- | --- | --- | ---
Non-portable | [](https://builds.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/)
Portable | --- | [](https://builds.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/)
| --- | ---
See
[.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md)
for trigger phrase, status and link of all Jenkins jobs.
----------------------------------------------------------------
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: 286986)
Time Spent: 10m
Remaining Estimate: 0h
> Interactive Beam example does not work with Python3
> ---------------------------------------------------
>
> Key: BEAM-7876
> URL: https://issues.apache.org/jira/browse/BEAM-7876
> Project: Beam
> Issue Type: Bug
> Components: examples-python
> Reporter: David Yan
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When going through the example
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/interactive/README.md]
> using Jupyter Notebook running in Python 3, the run() method throws an error
> the following error:
> {{TypeError Traceback (most recent call last)}}
> {{<ipython-input-3-6b6671c6b2d0> in <module>}}
> {{ 3 squares = init_pcoll | 'Square' >> beam.Map(lambda x: x*x)}}
> {{ 4 cubes = init_pcoll | 'Cube' >> beam.Map(lambda x: x**3)}}
> {{----> 5 result = p.run()}}
> {{ 6 result.wait_until_finish()}}{{~/beam/sdks/python/apache_beam/pipeline.py
> in run(self, test_runner_api)}}
> {{ 404 self.to_runner_api(use_fake_coders=True),}}
> {{ 405 self.runner,}}
> {{--> 406 self._options).run(False)}}
> {{ 407 }}
> {{ 408 if
> self._options.view_as(TypeOptions).runtime_type_check:}}{{~/beam/sdks/python/apache_beam/pipeline.py
> in run(self, test_runner_api)}}
> {{ 417 finally:}}
> {{ 418 shutil.rmtree(tmpdir)}}
> {{--> 419 return self.runner.run_pipeline(self, self._options)}}
> {{ 420 }}
> {{ 421 def
> __enter__(self):}}{{~/beam/sdks/python/apache_beam/runners/interactive/interactive_runner.py
> in run_pipeline(self, pipeline, options)}}
> {{ 142 cache_manager=self._cache_manager,}}
> {{ 143 pipeline_graph_renderer=self._renderer)}}
> {{--> 144 display.start_periodic_update()}}
> {{ 145 result = pipeline_to_execute.run()}}
> {{ 146
> result.wait_until_finish()}}{{~/beam/sdks/python/apache_beam/runners/interactive/display/display_manager.py
> in start_periodic_update(self)}}
> {{ 158 def start_periodic_update(self):}}
> {{ 159 """Start a thread that periodically updates the display."""}}
> {{--> 160 self.update_display(True)}}
> {{ 161 self._periodic_update = True}}
> {{
> 162}}{{~/beam/sdks/python/apache_beam/runners/interactive/display/display_manager.py
> in update_display(self, force)}}
> {{ 149 rendered_graph = self._renderer.render_pipeline_graph(}}
> {{ 150 self._pipeline_graph)}}
> {{--> 151 display.display(display.HTML(rendered_graph))}}
> {{ 152 }}
> {{ 153
> _display_progress('Running...')}}{{~/beam/sdks/python/notebook3/lib/python3.6/site-packages/IPython/core/display.py
> in __init__(self, data, url, filename, metadata)}}
> {{ 691 return prefix.startswith("<iframe ") and suffix.endswith("</iframe>")}}
> {{ 692 }}
> {{--> 693 if warn():}}
> {{ 694 warnings.warn("Consider using IPython.display.IFrame instead")}}
> {{ 695 super(HTML, self).__init__(data=data, url=url, filename=filename,
> metadata=metadata)}}{{~/beam/sdks/python/notebook3/lib/python3.6/site-packages/IPython/core/display.py
> in warn()}}
> {{ 689 prefix = data[:10].lower()}}
> {{ 690 suffix = data[-10:].lower()}}
> {{--> 691 return prefix.startswith("<iframe ") and
> suffix.endswith("</iframe>")}}
> {{ 692 }}
> {{ 693 if warn():}}{{TypeError: startswith first arg must be bytes or a tuple
> of bytes, not str}}
>
>
>
> This does not happen with Python 2.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)