Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/ansys/fluent/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def inactive_tasks(self) -> list:
"""
return []

def get_id(self) -> str:
def get_id(self) -> str: # pylint: disable=missing-raises-doc
"""Get the unique string identifier of this task, as it is in the application.

Returns
Expand All @@ -341,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.
Outdated
Comment thread
Gobot1234 marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I propose throwing TaskLookupError ---|> LookupError.

f"Task ID not found for task '{self.name()}'. "
"This may indicate the task was not properly initialized."
)
Comment thread
Gobot1234 marked this conversation as resolved.
Outdated

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