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.
[WIP]test: setup itk resubscribe tests #1031
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?
[WIP]test: setup itk resubscribe tests #1031
Changes from all commits
c7f3db7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check failure on line 54 in itk/main.py
ruff (F401)
Check failure on line 55 in itk/main.py
ruff (F401)
Check failure on line 84 in itk/main.py
ruff (RUF100)
Check failure on line 99 in itk/main.py
ruff (RUF100)
Check failure on line 134 in itk/main.py
ruff (PLR0912)
Check failure on line 163 in itk/main.py
ruff (SIM114)
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.
The logic to extract
task_objfrom the event is potentially incorrect. For a protobuf message likeStreamResponse,hasattr(event, 'task')will always beTrue, but this doesn't mean thetaskfield is actually set in the message. Accessingevent.taskwhen the field is not set will give you a defaultTaskinstance, which is likely not what you want. The correct way to check for presence isevent.HasField('task').The
elifcondition is currently unreachable because theifcondition will always be met for aStreamResponseobject. I suggest simplifying this block to correctly check for thetaskfield.Check failure on line 179 in itk/main.py
ruff (PLR1714)
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.
Comparing the
roleenum field with strings like'ROLE_AGENT'or'agent'is not reliable and is likely incorrect. Protobuf enums in Python are integers, so this comparison will likely always evaluate to false. You should comparemsg.rolewith the actual enum member.To do this, you'll need to import
Rolefroma2a.types.a2a_pb2at the top of the file.Check failure on line 182 in itk/main.py
ruff (PERF401)
Check failure on line 190 in itk/main.py
ruff (TRY400)
Check failure on line 251 in itk/main.py
ruff (S106)
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.
The
contextparameter ofBasePushNotificationSenderis deprecated and will be removed in a future version. The constructor logs a warning when it is used. You can safely remove it from this call.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.
The
log_levelforuvicornis now hardcoded to'info'. This removes the ability to configure it using theITK_LOG_LEVELenvironment variable. It's better to restore the previous behavior to allow for flexible log level configuration during testing.Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.