-
Notifications
You must be signed in to change notification settings - Fork 627
Fix FastAPI deprecation warnings by migrating to lifespan handlers #2402
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
Fix FastAPI deprecation warnings by migrating to lifespan handlers #2402
Conversation
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.
Thanks @hafeezhmha! It looks like every file in the repo changed line endings. If you can get that sorted out we'll review!
366cf0a
to
4487e74
Compare
4487e74
to
07f0848
Compare
@michaeldwan Hi, can you have a look, I have sorted them out. |
Signed-off-by: Hafeez <90968109+hafeezhmha@users.noreply.github.com>
@michaeldwan the PR works , there are no deprecation warnings anymore. Can you please test it out. The file already has some todos and fixes which i have kept as is. I have only updated the fastAPI part. |
Awesome, thanks! I'll run the tests and take a look. |
Signed-off-by: Hafeez <90968109+hafeezhmha@users.noreply.github.com>
@michaeldwan Alright! |
Signed-off-by: Hafeez <90968109+hafeezhmha@users.noreply.github.com>
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.
Looks great, thanks for the quick fixes!
Fix FastAPI deprecation warnings
Problem
Cog currently uses deprecated
@app.on_event()
handlers which cause deprecation warnings in FastAPI.Solution
@app.on_event("startup")
and@app.on_event("shutdown")
to FastAPI's lifespan handlersasynccontextmanager
Testing
cog predict