[ 
https://issues.apache.org/jira/browse/BEAM-12716?focusedWorklogId=635884&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-635884
 ]

ASF GitHub Bot logged work on BEAM-12716:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Aug/21 14:28
            Start Date: 09/Aug/21 14:28
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on a change in pull request 
#15269:
URL: https://github.com/apache/beam/pull/15269#discussion_r685240066



##########
File path: sdks/python/apache_beam/examples/kafkataxi/kafka_taxi.py
##########
@@ -43,34 +52,43 @@ def run(bootstrap_servers, topic, with_metadata, 
pipeline_args):
   #                  '--num_workers', 'my-num-workers',
   #                  '--experiments', 'use_runner_v2']
 
-  pipeline_options = PipelineOptions(
-      pipeline_args, save_main_session=True, streaming=True)
   window_size = 15  # size of the Window in seconds.
 
-  def log_ride_with_metadata(record):
+  def log_ride(ride):
+    if 'timestamp' in ride:
+      logging.info(
+          'Found ride at latitude %r and longitude %r with %r '
+          'passengers at timestamp %r',
+          ride['latitude'],
+          ride['longitude'],
+          ride['passenger_count'],
+          ride['timestamp'])
+    else:
+      logging.info(
+          'Found ride at latitude %r and longitude %r with %r '
+          'passengers',
+          ride['latitude'],
+          ride['longitude'],
+          ride['passenger_count'])
+
+  def convert_kafka_record_to_dictionary(record):
+    if hasattr(record, 'value'):

Review comment:
       Let's add a comment here to clarify. ("if" condition becomes true when 
reading with metadata).




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 635884)
    Time Spent: 2h 10m  (was: 2h)

> Update XLang Kafka taxi example to use BigQuery sink
> ----------------------------------------------------
>
>                 Key: BEAM-12716
>                 URL: https://issues.apache.org/jira/browse/BEAM-12716
>             Project: Beam
>          Issue Type: Improvement
>          Components: cross-language, testing
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: P2
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Update XLang Kafka taxi example to use BigQuery sink



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to