[
https://issues.apache.org/jira/browse/BEAM-7389?focusedWorklogId=328243&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-328243
]
ASF GitHub Bot logged work on BEAM-7389:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Oct/19 01:05
Start Date: 15/Oct/19 01:05
Worklog Time Spent: 10m
Work Description: aaltay commented on pull request #9790: [BEAM-7389]
Show code snippet outputs as stdout
URL: https://github.com/apache/beam/pull/9790#discussion_r334716595
##########
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]
+ assert_that(actual, equal_to(expected))
def check_valid_plants(actual):
- # [START valid_plants]
- valid_plants = [
- {'icon': '🍓', 'name': 'Strawberry', 'duration': 'perennial'},
- {'icon': '🥕', 'name': 'Carrot', 'duration': 'biennial'},
- {'icon': '🍆', 'name': 'Eggplant', 'duration': 'perennial'},
- {'icon': '🍅', 'name': 'Tomato', 'duration': 'annual'},
- ]
- # [END valid_plants]
- assert_that(actual, equal_to(valid_plants))
+ expected = '''[START valid_plants]
+{'icon': '🍓', 'name': 'Strawberry', 'duration': 'perennial'}
+{'icon': '🥕', 'name': 'Carrot', 'duration': 'biennial'}
+{'icon': '🍆', 'name': 'Eggplant', 'duration': 'perennial'}
+{'icon': '🍅', 'name': 'Tomato', 'duration': 'annual'}
+[END valid_plants]'''.splitlines()[1:-1]
+ assert_that(actual, equal_to(expected))
@mock.patch('apache_beam.Pipeline', TestPipeline)
-# pylint: disable=line-too-long
[email protected]('apache_beam.examples.snippets.transforms.elementwise.filter.print',
lambda elem: elem)
[email protected]('apache_beam.examples.snippets.transforms.elementwise.filter.print',
str)
Review comment:
I do not believe we should make an exception on disabling lint on these.
----------------------------------------------------------------
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: 328243)
Time Spent: 68h (was: 67h 50m)
> 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: 68h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)