-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Bug Fix] Create/Update team member api 500 errror #10479
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 Fix] Create/Update team member api 500 errror #10479
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
e65bf30
to
d3e035a
Compare
This should be ready for review. Despite lint check fail, all unit tests appear to be good. (And this does not test the actual issue with Prisma/database which I've provided some curl commands to reproduce in the #10477 issue ticket |
ce7693a
to
983f1a2
Compare
Attaching curl tests from bug report #10477... Before this patch, it will give a 500 error |
Hi @krrishdholakia, I know you're likely insanely busy. But is there any chance this PR is something that could be reviewed (or get put on a short list of ready to be reviewed by someone). There is no huge hurry, I just don't want to see it get lost in the stream of PR's you're already working through. Thanks! |
983f1a2
to
7dbde21
Compare
await prisma_client.db.litellm_teammembership.create( | ||
data={ | ||
"team_id": data.team_id, | ||
async with prisma_client.db.tx() as tx: |
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.
hey @hagan can we refactor this into a separate function - and then have an isolated test for just this - it'll prevent bloat
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.
@krrishdholakia didn't think you'd be taking a look at this so quickly. Glad you caught this version. I just started to refactoring (somewhat related to a new bug) Found that deleting a budget broke team listing too. I think the delete issue is caused in the schema and _type.py.. Which I imagine you'll also want me to break out as different PR?
And I'm happy to turn this into a function. As for testing, are there examples in your github actions that I can use to do db testing? I ended up breaking out this fix into my team version of litellm: -> https://github.com/cyverse/litellm-docker/blob/main/patch_tests/20250514-patch-test.sh
}, | ||
) | ||
elif identified_budget_id is not None: | ||
await prisma_client.db.litellm_budgettable.update( |
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.
this is the major change, correct?
seems like the error is triggered when trying to update budget for an existing member w/ a budget
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.
Yes, this seemed to be the bulk of change to fix the create/update budget
9e3c850
to
59681ae
Compare
@krrishdholakia I made that change you suggested and added a test to check that_upsert_budget_and_membership does work. Latest local tests pass: The lint check is failing, dunno why.. And when I ran the full test suit locally, it now fails. Not sure didn't work either. But appears the github action checked out (minus lint) and almost passed? |
612e85d
to
817d77e
Compare
Thanks @hagan monitoring this |
817d77e
to
eae002b
Compare
@krrishdholakia It looks like it passed this time, phew.... Locally when I used |
LGTM! Thanks for your help on this |
* Fixes issue with team_endpoints on member budget update * refactored location of budget membership fix * added test for _upsert_budget_membership func
[Bug fix] /team/member_update API endpoint raises 500 error
Fixes issue raised here: #10477
Note:
I have not created tests yet, not sure how to go about testing a database/Prisma issue since regular unit tests don't cut it..Update: Added simple test for api endpoint and manually tested db below shownRelevant issues
None that I could find
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🐛 Bug Fix
✅ Test
Changes