diff --git a/doc/changelog.d/5047.fixed.md b/doc/changelog.d/5047.fixed.md new file mode 100644 index 00000000000..5a1b472e495 --- /dev/null +++ b/doc/changelog.d/5047.fixed.md @@ -0,0 +1 @@ +BaseTask.get_id potentially returning None diff --git a/src/ansys/fluent/core/workflow.py b/src/ansys/fluent/core/workflow.py index 98a5d09050f..3d4a051cb1b 100644 --- a/src/ansys/fluent/core/workflow.py +++ b/src/ansys/fluent/core/workflow.py @@ -325,7 +325,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 @@ -340,6 +340,10 @@ def get_id(self) -> str: type_, id_ = k.split(":") if type_ == "TaskObject": return id_ + raise RuntimeError( + f"Task ID not found for task '{self.name()}'. " + "This may indicate the task was not properly initialized." + ) def get_idx(self) -> int: """Get the unique integer index of this task, as it is in the application.