-
Notifications
You must be signed in to change notification settings - Fork 259
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
[Bug]: Multiple return values from a decorated function become a list #607
Labels
bug
Something isn't working
Comments
I fixed the bug in this pr: #608 |
Taking a look at the PR, thanks! @zli11010 are you using a specific project or rolling out an agent of your own? |
teocns
added a commit
to zli11010/agentops
that referenced
this issue
Jan 4, 2025
Added tests to verify PR AgentOps-AI#608, which fixes decorators changing tuple outputs into lists. Checks: 1. Decorators keep the original return type for: - Simple tuples like (1, "test") - Named tuples like Point(x=1, y=2) - Nested tuples containing multiple values - Custom tuple types (fixing bug AgentOps-AI#607) 2. Tests also show that JSON handles tuples correctly without needing to convert them to lists first, proving the point that the conversion was unnecessary.
teocns
added a commit
that referenced
this issue
Jan 9, 2025
* [Fix] Removed unnecessarily changing tuple output to list output * Revert "[Fix] Removed unnecessarily changing tuple output to list output" This reverts commit 829fa43. * Fix multiple returns being modified by decorator * test: Add tests to ensure @record_* decorators don't change return types Added tests to verify PR #608, which fixes decorators changing tuple outputs into lists. Checks: 1. Decorators keep the original return type for: - Simple tuples like (1, "test") - Named tuples like Point(x=1, y=2) - Nested tuples containing multiple values - Custom tuple types (fixing bug #607) 2. Tests also show that JSON handles tuples correctly without needing to convert them to lists first, proving the point that the conversion was unnecessary. --------- Co-authored-by: Pratyush Shukla <[email protected]> Co-authored-by: teocns <[email protected]> Co-authored-by: Teo <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Contact Details
No response
π¦ Package Version
0.3.18
ποΈ Framework Version
No response
π Describe the Bug
If I do something like
then the output becomes the list
[0, 1]
.This is an issue because I'm using a repository where they check whether the output from a function is a specific subclass of
tuple
, so when I added the decorator to the function the code broke.π€ Contribution
The text was updated successfully, but these errors were encountered: