Skip to content

fix: Safely populate report-def-changed/plot-set-changed event-info#5060

Open
mkundu1 wants to merge 2 commits intomainfrom
fix/report-def-event
Open

fix: Safely populate report-def-changed/plot-set-changed event-info#5060
mkundu1 wants to merge 2 commits intomainfrom
fix/report-def-event

Conversation

@mkundu1
Copy link
Copy Markdown
Contributor

@mkundu1 mkundu1 commented Apr 8, 2026

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.

Copilot AI review requested due to automatic review settings April 8, 2026 14:38
@github-actions github-actions bot added the bug Issue, problem or error in PyFluent label Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @dataclass to several event-info classes so they can be introspected via dataclasses.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.

Comment thread src/ansys/fluent/core/streaming_services/events_streaming.py
Comment thread src/ansys/fluent/core/streaming_services/events_streaming.py
Comment thread src/ansys/fluent/core/streaming_services/events_streaming.py
Comment thread doc/changelog.d/5060.fixed.md
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyFluent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants