You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/08/02 06:15:00 UTC

[jira] [Work logged] (BEAM-2855) Implement a Python version of the Nexmark queries

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

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

                Author: ASF GitHub Bot
            Created on: 02/Aug/20 06:14
            Start Date: 02/Aug/20 06:14
    Worklog Time Spent: 10m 
      Work Description: leiyiz commented on a change in pull request #12427:
URL: https://github.com/apache/beam/pull/12427#discussion_r464037245



##########
File path: sdks/python/apache_beam/testing/benchmarks/nexmark/models/nexmark_model.py
##########
@@ -26,31 +26,55 @@
   - The bid on an item for auction (Bid).
 
 """
+from apache_beam.coders import coder_impl
+from apache_beam.coders.coders import FastCoder
+from apache_beam.coders.coders import StrUtf8Coder
+from apache_beam.testing.benchmarks.nexmark import nexmark_util
+
+
+class PersonCoder(FastCoder):
+  def _create_impl(self):
+    return PersonCoderImpl()
+
+  def is_deterministic(self):
+    # type: () -> bool
+    return True
 
 
 class Person(object):
   "Author of an auction or a bid."
+  CODER = PersonCoder()
 
   def __init__(
-      self, id, name, email, credit_card, city, state, timestamp, extra=None):
+      self, id, name, email, credit_card, city, state, date_time, extra=None):
     self.id = id
     self.name = name
-    self.email = email  # key
+    self.email_address = email  # key
     self.credit_card = credit_card
     self.city = city
     self.state = state
-    self.timestamp = timestamp
+    self.date_time = date_time
     self.extra = extra
 
   def __repr__(self):
-    return 'Person({id}, {email})'.format(
-        **{
-            'id': self.id, 'email': self.email
-        })
+    return nexmark_util.model_to_json(self)
+
+
+class AuctionCoder(FastCoder):
+  def to_type_hint(self):

Review comment:
       my bad it is a mistake..




----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 465359)
    Time Spent: 14h  (was: 13h 50m)

> Implement a Python version of the Nexmark queries
> -------------------------------------------------
>
>                 Key: BEAM-2855
>                 URL: https://issues.apache.org/jira/browse/BEAM-2855
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core, testing, testing-nexmark
>            Reporter: Ismaël Mejía
>            Priority: P3
>              Labels: newbie, nexmark, starter
>          Time Spent: 14h
>  Remaining Estimate: 0h
>
> Currently we have a Java only implementation of Nexmark, a python based implementation would be nice to have to validate the direct and dataflow runners, but also to validate the new support of multiple SDKs in multiple runners via the runner/fn API.



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