fix: Safely populate report-def-changed/plot-set-changed event-info#5060
Open
fix: Safely populate report-def-changed/plot-set-changed event-info#5060
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes population of PyFluent event-info objects from streamed events.proto payloads when the proto includes fields that no longer exist on the corresponding Python event-info classes.
Changes:
- Add
@dataclassto several event-info classes so they can be introspected viadataclasses.fields(). - Update
_construct_event_info()to populate event-info instances using keyword arguments built from dataclass fields, avoiding “too many positional arguments” when the streamed payload has extra fields. - Add a changelog fragment documenting the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/ansys/fluent/core/streaming_services/events_streaming.py | Switch event-info construction to dataclass field-based kwargs and mark more event-info types as dataclasses. |
| doc/changelog.d/5060.fixed.md | Document the fix in the changelog fragments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Up to standards ✅🟢 Issues
|
prmukherj
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
report-name and plot-set-name fields were removed from PyFluent's event-info classes, but those fields still exist in events.proto and therefore in the streamed response. This causes an issue while populating PyFluent's event-info from the streamed data in a generic manner.
Change Summary
PyFluent's event-info class is safely populated with only required number of fields as per the respective class definition.
I've also opened https://github.com/ansys-internal/ansys-api-fluent/issues/118 to fix events.proto in version v1.
Rationale
This could also be fixed by deprecating those fields in v0 version of events.proto, but as we'll get a new version soon, the existing .proto is not changed.
Impact
This will fix event callbacks for report-def-changed/plot-set-changed event, fixes Fluent bug 1286890 in PyFluent.