-
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
Open
Copilot
wants to merge
7
commits into
main
Choose a base branch
from
copilot/fix-basetask-get-id-none
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6
−1
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e5c8579
Initial plan
Copilot 421f54b
Fix BaseTask.get_id to raise RuntimeError when task ID not found
Copilot c73fca2
Improve RuntimeError message in BaseTask.get_id
Copilot f549ee5
chore: adding changelog file 5047.fixed.md [dependabot-skip]
pyansys-ci-bot 805e6dd
Merge branch 'main' into copilot/fix-basetask-get-id-none
Gobot1234 e66c8a2
Ignore lint error, you shouldn't be catching this runtime error expli…
Gobot1234 c43e21a
Apply suggestion from @Gobot1234
Gobot1234 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| BaseTask.get_id potentially returning None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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( | ||
|
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. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.