-
Notifications
You must be signed in to change notification settings - Fork 5k
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
task: added warning when none is called in intervention handler #4149
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
@@ -14,6 +14,27 @@ | |||
class DropMessage: ... | |||
|
|||
|
|||
def warn_if_none(result: Any, handler_name: str) -> Any: |
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.
Please name this with a leading underscore to indicate private
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.
Sorry for the late reply, I went on a weekend trip. Done.
python/packages/autogen-core/src/autogen_core/base/intervention.py
Outdated
Show resolved
Hide resolved
@goyalpramod would you be able to fix the two failing checks? You can find instructions here https://github.com/microsoft/autogen/tree/main/python#development |
Why are these changes needed?
The user may be returning none by mistake, explicitly informing them about it can be helpful
I have used the Python in-built library warnings to fix this issue, it checks if a handler call is None, if it is. It returns a warning otherwise returns the original result
Related issue number
Closes #3621
Note
I ran all tests and ran into some issues with
autogen-core\tests\execution\test_user_defined_functions.py
. I am unsure if it was caused by my changes, but I believe that should not be the case.Checks