Replies: 8 comments
-
Can you provide a minimal working example? |
Beta Was this translation helpful? Give feedback.
-
models/student.py
routers/student.py
schemas/notes.py
models/note.py
I think these are all the relevant files. |
Beta Was this translation helpful? Give feedback.
-
Any updates? Any relationship where lazy='dynamic' is defined creates a stack overflow in FastAPI. |
Beta Was this translation helpful? Give feedback.
-
Maybe this helps? #194 🤔 |
Beta Was this translation helpful? Give feedback.
-
Thank you, but |
Beta Was this translation helpful? Give feedback.
-
Bump. We really need to solve this before we can continue our project. @Kludex - do you need any additional information from us? |
Beta Was this translation helpful? Give feedback.
-
Another example: models/user.py:
schemas/users.py:
models/notification.py:
schemas/notifications.py:
routers/users.py:
This works like expected. However, when we want to filter to only show the unread notifications to the user, things start to act crazy. We make the following changes: models/user.py:
routers/users.py:
This causes the following error:
That is weird - nothing should be changed in the output (this user only has unread notifications). When we remove the response model to check the output, we get the stack overflow as posted in this issue. Are we doing something wrong? Is FastAPI doing something wrong? Is SQLAlchemy doing something wrong? |
Beta Was this translation helpful? Give feedback.
-
I don't think the "dynamic" strategy can be applied, I think I've faced the same issue some time ago, but I need to recheck the If you want help, you should probably add a proper minimal working example i.e. that ppl can copy/paste/clone and just run. In any case, you can check if other |
Beta Was this translation helpful? Give feedback.
-
First Check
Commit to Help
Example Code
Description
Hi,
I hope you are all well. I'm using FastAPI in combination with SQLAlchemy, so I'm not really sure if I should post this there or here, but from the logs it seems that FastAPI is causing the stack overflow.
I have the following defined in my Student-model:
And this is my function in the router which when I run it causes the stack overflow:
This is the error that is being generated upon running the function above:
Once again, not sure if it's FastAPI, but it seems that way. Thanks in advance!
Operating System
macOS
Operating System Details
No response
FastAPI Version
0.68.1
Python Version
Python 3.9.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions