-
Notifications
You must be signed in to change notification settings - Fork 67
fix: BaseTask.get_id potentially returning None #5047
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
e5c8579
421f54b
c73fca2
f549ee5
805e6dd
e66c8a2
c43e21a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| BaseTask.get_id potentially returning None |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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: | ||
|
Gobot1234 marked this conversation as resolved.
Outdated
|
||
| """Get the unique string identifier of this task, as it is in the application. | ||
|
||
|
|
||
| Returns | ||
|
|
@@ -340,6 +341,10 @@ def get_id(self) -> str: | |
| type_, id_ = k.split(":") | ||
| if type_ == "TaskObject": | ||
| return id_ | ||
| raise RuntimeError( | ||
|
Gobot1234 marked this conversation as resolved.
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
|
||
|
|
||
| def get_idx(self) -> int: | ||
| """Get the unique integer index of this task, as it is in the application. | ||
|
|
||
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.
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.