-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Raise exception on read-only command execution #4619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new exception type ReadOnlyActionError to prevent execution of read-only commands and queries in PyFluent. Previously, the system allowed executing read-only commands/queries, which was incorrect behavior.
Key Changes:
- Added
ReadOnlyActionErrorexception class for read-only command/query execution attempts - Implemented checks in command and query
__call__methods to raise the exception when read-only - Added test coverage for the new exception behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/ansys/fluent/core/solver/flobject.py | Added ReadOnlyActionError exception class and read-only checks in command/query execution methods |
| tests/test_settings_api.py | Added test_read_only_command_execution test and imported new exception types |
| tests/conftest.py | Added mixing_elbow_case_session fixture to support the new test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Relevant Fluent ADO id - 1354052 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
Earlier it was possible to execute a read-only command or query.
Change Summary
A new exception-type is raised when user tries to execute a read-only command/query. Note that, attribute access of read-only command/query and its arguments should still work.
Rationale
We already throw a different exception-type from PyFluent when user tries to execute an inactive command/query. Raising of the new exception for read-only command/query has been at the same place.
Impact
This will fix the current incorrect behaviour, a new unittest has been added.