Skip to content

Commit dae94d0

Browse files
committed
add expected blocks
1 parent ee6f778 commit dae94d0

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

sdks/python/apache_beam/yaml/examples/bigtable_enrichment.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ pipeline:
4848
# We can also store it somewhere like a json file
4949
- type: LogForTesting
5050

51-
# Expected:
52-
# Row(sale_id = 1, customer_id = 1, product_id = 1, quantity = 1, product = Row(product_id: "1", product_name = "pixel 5", product_stock = "2"))
51+
options:
52+
yaml_experimental_features: Enrichment
53+
54+
# Expected:
55+
# Row(sale_id=1, customer_id=1, product_id=1, quantity=1, product={'product_id': '1', 'product_name': 'pixel 5', 'product_stock': '2'})

sdks/python/apache_beam/yaml/examples/enrich_spanner_with_bigquery.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ pipeline:
9494
config:
9595
path: 'errors.json'
9696

97+
# Expected:
98+
# Row(customer_id=1001, customer_name='Alice', customer_email='[email protected]', product_id=2001, order_date='24-03-24', order_amount=150)
99+
# Row(customer_id=1003, customer_name='Claire', customer_email='[email protected]', product_id=2003, order_date='7-05-24', order_amount=110)

sdks/python/apache_beam/yaml/examples/testing/examples_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ def _wordcount_test_preprocessor(
155155
env.input_file('kinglear.txt', '\n'.join(lines)))
156156

157157

158-
@YamlExamplesTestSuite.register_test_preprocessor(
159-
['test_simple_filter_yaml', 'test_simple_filter_and_combine_yaml', 'test_spanner_read_yaml', 'test_spanner_write_yaml'])
158+
@YamlExamplesTestSuite.register_test_preprocessor([
159+
'test_simple_filter_yaml',
160+
'test_simple_filter_and_combine_yaml',
161+
'test_spanner_read_yaml',
162+
'test_spanner_write_yaml',
163+
'test_bigtable_enrichment_yaml',
164+
'test_enrich_spanner_with_bigquery_yaml'
165+
])
160166
def _file_io_write_test_preprocessor(
161167
test_spec: dict, expected: List[str], env: TestEnvironment):
162168

0 commit comments

Comments
 (0)