tvalentyn commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2449125640
##########
sdks/python/apache_beam/testing/benchmarks/nexmark/models/nexmark_model.py:
##########
@@ -58,9 +57,6 @@ def __init__(
self.date_time = date_time
self.extra = extra
- def __repr__(self):
Review Comment:
it's a bit awkward to pass nexmark_types around. would it solve the circular
dependency problem if we moved
```
def model_to_json(model):
return json.dumps(construct_json_dict(model), separators=(',', ':'))
def construct_json_dict(model):
return {k: unnest_to_json(v) for k, v in model.__dict__.items()}
def unnest_to_json(cand):
if isinstance(cand, Timestamp):
return cand.micros // 1000
elif isinstance(cand, (Auction, Bid, Person)):
return construct_json_dict(cand)
else:
return cand
```
to nexmark_model.py instead of nexmark_util?
--
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]