Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/5047.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BaseTask.get_id potentially returning None
7 changes: 6 additions & 1 deletion src/ansys/fluent/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ def inactive_tasks(self) -> list:
"""
return []

def get_id(self) -> str:
# pylint: disable=missing-raises-doc
def get_id(self) -> str:
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

There is trailing whitespace after the function signature (def get_id(self) -> str:), which will typically trigger linting (e.g., W291). Please remove the extra spaces.

Suggested change
def get_id(self) -> str:
def get_id(self) -> str:

Copilot uses AI. Check for mistakes.
Comment thread
Gobot1234 marked this conversation as resolved.
Outdated
"""Get the unique string identifier of this task, as it is in the application.
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

The # pylint: disable=missing-raises-doc directive here will apply beyond get_id() (until re-enabled), which can unintentionally suppress missing-raises-doc warnings for the rest of this large module. Prefer documenting the new RuntimeError in the docstring with a Raises section and removing the disable; if a disable is still needed, scope it to just this function and re-enable immediately after.

Copilot uses AI. Check for mistakes.

Returns
Expand All @@ -340,6 +341,10 @@ def get_id(self) -> str:
type_, id_ = k.split(":")
if type_ == "TaskObject":
return id_
raise RuntimeError(
Comment thread
Gobot1234 marked this conversation as resolved.
Comment thread
Gobot1234 marked this conversation as resolved.
f"Task ID not found for task '{self.name()}'. "
"This may indicate the task was not properly initialized."
)
Comment on lines +343 to +346
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

This change introduces a new error path (raising RuntimeError when the task name is missing from workflow state). Please add/adjust a test to assert this behavior so regressions don’t reintroduce the previous implicit None return (and downstream TypeError).

Copilot uses AI. Check for mistakes.

def get_idx(self) -> int:
"""Get the unique integer index of this task, as it is in the application.
Expand Down
Loading