You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "celeste-zeng (via GitHub)" <gi...@apache.org> on 2025/10/14 18:54:13 UTC

[PR] Address circular dependencies in Nexmark benchmark suite. [beam]

celeste-zeng opened a new pull request, #36513:
URL: https://github.com/apache/beam/pull/36513

   - Previously we had: `nexmark_model.py -> nexmark_util.py -> nexmark_model.py` and
   `auction_bid.py -> nexmark_util.py -> auction_bid.py`
   
   - Now refactors the Nexmark benchmark suite by moving JSON serialization and timestamp conversion functions from `nexmark_util.py` to  `nexmark_json_util.py`.


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "celeste-zeng (via GitHub)" <gi...@apache.org>.
celeste-zeng commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2446436103


##########
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:
   Done, refactored `nexmark_json_util.py` to remove its dependency on `nexmark_model.py` by passing the required Nexmark model types as arguments to its functions, and added back the `__repr__` methods in `nexmark_model.py` to provide these types. Thanks!



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "celeste-zeng (via GitHub)" <gi...@apache.org>.
celeste-zeng commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3423811662

   R: @tvalentyn
   I don't think the test failures are caused by this PR, thanks!


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3403921244

   Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3427667227

   (accidentally clicked approve)


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3404802655

   Assigning reviewers:
   
   R: @shunping for label python.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2449017029


##########
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:
   I don't quite follow - why are we changing `model_to_json(self)` to `model_to_json(Person, Auction, Bid)` ?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3403182882

   ## Summary of Changes
   
   Hello @celeste-zeng, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
   
   This pull request refactors the Nexmark benchmark suite to eliminate circular dependencies between core modules. By extracting common JSON serialization and timestamp conversion logic into a new `nexmark_json_util.py` file, the interdependencies between `nexmark_model.py`, `nexmark_util.py`, and `auction_bid.py` are resolved, leading to a cleaner and more maintainable code structure.
   
   ### Highlights
   
   * **Circular Dependency Resolution**: Identified and resolved circular dependencies within the Nexmark benchmark suite, specifically between `nexmark_model.py` and `nexmark_util.py`, and `auction_bid.py` and `nexmark_util.py`.
   * **New Utility Module**: Extracted common JSON serialization and timestamp conversion functions from `nexmark_util.py` into a new dedicated module, `nexmark_json_util.py`.
   * **Module Updates**: Updated `auction_bid.py`, `nexmark_model.py`, and `nexmark_util.py` to import and utilize the newly created `nexmark_json_util.py` for JSON and timestamp operations.
   
   
   
   
   
   
   
   <details>
   <summary><b>Using Gemini Code Assist</b></summary>
   <br>
   
   The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
   
   <b>Invoking Gemini</b>
   
   You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
   
   Feature | Command | Description
   --- | --- | ---
   Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
   Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
   Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
   Help | `/gemini help` | Displays a list of available commands.
   
   <b>Customization</b>
   
   To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
   
   <b>Limitations & Feedback</b>
   
   Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
   
   <b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>
   </details>
   
   
   
   
   [^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
   


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "celeste-zeng (via GitHub)" <gi...@apache.org>.
celeste-zeng commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3423191175

   Run Python_Transforms PreCommit 3.13


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn merged PR #36513:
URL: https://github.com/apache/beam/pull/36513


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2449031315


##########
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:
   nvm, we change it to `model_to_json(self, Person, Auction, Bid)`, still passing the model. Still looking 



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2449968272


##########
sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_util.py:
##########
@@ -155,8 +154,7 @@ def process(self, elem):
           json_dict[FieldNames.CREDIT_CARD],
           json_dict[FieldNames.CITY],
           json_dict[FieldNames.STATE],
-          nexmark_json_util.millis_to_timestamp(
-              json_dict[FieldNames.DATE_TIME]),
+          nexmark_model.millis_to_timestamp(json_dict[FieldNames.DATE_TIME]),

Review Comment:
   nit: millis_to_timestamp can stay in this file, it's not causing a circular dep.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #36513:
URL: https://github.com/apache/beam/pull/36513#issuecomment-3423814733

   Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment `assign set of reviewers`


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2446257786


##########
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:
   what's the impact of removing `__repr__` ? can we resolve circular dependency without making these changes?   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Address circular dependencies in Nexmark benchmark suite. [beam]

Posted by "celeste-zeng (via GitHub)" <gi...@apache.org>.
celeste-zeng commented on code in PR #36513:
URL: https://github.com/apache/beam/pull/36513#discussion_r2449924146


##########
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:
   Done, removed the added file and moved JSON serialization and timestamp conversion functions from `nexmark_util.py` to `nexmark_model.py`. Thanks!



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org