-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make ModelRetry hashable
#3394
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
Make ModelRetry hashable
#3394
Conversation
This change adds a `__hash__` method to the `ModelRetry` exception class, making it hashable so it can be used in sets and as dictionary keys. The hash is based on both the class type and the message attribute, which aligns with the existing `__eq__` implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
@nathan-gage Hey Nathan, the change looks fine (just lacking test coverage), but I'd like the understand the issue you were seeing with |
Tests that all exception classes are hashable and can be used as dict keys and set members. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Here is the traceback`ddtrace` configWe are using and instrumented like: I believe the problem is that Exceptions defined with |
|
@nathan-gage Thanks Nathan, makes sense. |
ModelRetryis not hashable -- this broke some compatibility with our telemetry sdk (ddtracespecifically).Am not 100% familiar with the lore, hopefully this is ok!
Summary
__hash__method toModelRetryexception class to make it hashableTest plan
🤖 Generated with Claude Code