[
https://issues.apache.org/jira/browse/BEAM-7389?focusedWorklogId=328223&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-328223
]
ASF GitHub Bot logged work on BEAM-7389:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Oct/19 23:32
Start Date: 14/Oct/19 23:32
Worklog Time Spent: 10m
Work Description: davidcavazos commented on pull request #9790:
[BEAM-7389] Show code snippet outputs as stdout
URL: https://github.com/apache/beam/pull/9790#discussion_r334700424
##########
File path:
sdks/python/apache_beam/examples/snippets/transforms/elementwise/filter_test.py
##########
@@ -31,31 +31,26 @@
def check_perennials(actual):
- # [START perennials]
- perennials = [
- {'icon': '🍓', 'name': 'Strawberry', 'duration': 'perennial'},
- {'icon': '🍆', 'name': 'Eggplant', 'duration': 'perennial'},
- {'icon': '🥔', 'name': 'Potato', 'duration': 'perennial'},
- ]
- # [END perennials]
- assert_that(actual, equal_to(perennials))
+ expected = '''[START perennials]
+{'icon': '🍓', 'name': 'Strawberry', 'duration': 'perennial'}
+{'icon': '🍆', 'name': 'Eggplant', 'duration': 'perennial'}
+{'icon': '🥔', 'name': 'Potato', 'duration': 'perennial'}
+[END perennials]'''.splitlines()[1:-1]
Review comment:
It is a little weird in the code, but it shows a lot nicer in the docs this
way. That's the actual output people will get when running the code, rather
than the lists.
The [START] and [END] tags need to be as part of the string so we can only
extract the desired output, but they are being filtered out with the
`.splitlines()[1:-1]`.
----------------------------------------------------------------
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: 328223)
Time Spent: 67h 10m (was: 67h)
> Colab examples for element-wise transforms (Python)
> ---------------------------------------------------
>
> Key: BEAM-7389
> URL: https://issues.apache.org/jira/browse/BEAM-7389
> Project: Beam
> Issue Type: Improvement
> Components: website
> Reporter: Rose Nguyen
> Assignee: David Cavazos
> Priority: Minor
> Time Spent: 67h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)