You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2020/10/22 17:52:06 UTC
[beam] branch master updated: [BEAM-11101] Fix BigQuery snippets
(#13167)
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 47803de [BEAM-11101] Fix BigQuery snippets (#13167)
47803de is described below
commit 47803de1953b5847fd59ad8f75368091b1932c5c
Author: Pablo <pa...@users.noreply.github.com>
AuthorDate: Thu Oct 22 10:51:28 2020 -0700
[BEAM-11101] Fix BigQuery snippets (#13167)
* [BEAM-11101] Fix BigQuery snippets
* Update sdks/python/apache_beam/examples/snippets/snippets.py
Co-authored-by: Lukasz Cwik <lc...@google.com>
---
sdks/python/apache_beam/examples/snippets/snippets.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sdks/python/apache_beam/examples/snippets/snippets.py b/sdks/python/apache_beam/examples/snippets/snippets.py
index 844464a..8f557f6 100644
--- a/sdks/python/apache_beam/examples/snippets/snippets.py
+++ b/sdks/python/apache_beam/examples/snippets/snippets.py
@@ -1182,7 +1182,8 @@ def model_bigqueryio(p, write_project='', write_dataset='', write_table=''):
# [START model_bigqueryio_write_dynamic_destinations]
fictional_characters_view = beam.pvalue.AsDict(
- p | beam.Create([('Yoda', True), ('Obi Wan Kenobi', True)]))
+ p | 'CreateCharacters' >> beam.Create([('Yoda', True),
+ ('Obi Wan Kenobi', True)]))
def table_fn(element, fictional_characters):
if element in fictional_characters:
@@ -1190,7 +1191,7 @@ def model_bigqueryio(p, write_project='', write_dataset='', write_table=''):
else:
return 'my_dataset.real_quotes'
- quotes | beam.io.WriteToBigQuery(
+ quotes | 'WriteWithDynamicDestination' >> beam.io.WriteToBigQuery(
table_fn,
schema=table_schema,
table_side_inputs=(fictional_characters_view, ),
@@ -1199,7 +1200,7 @@ def model_bigqueryio(p, write_project='', write_dataset='', write_table=''):
# [END model_bigqueryio_write_dynamic_destinations]
# [START model_bigqueryio_time_partitioning]
- quotes | beam.io.WriteToBigQuery(
+ quotes | 'WriteWithTimePartitioning' >> beam.io.WriteToBigQuery(
table_spec,
schema=table_schema,
write_disposition=beam.io.BigQueryDisposition.WRITE_TRUNCATE,