Repository navigation
Sync fastapi-url-shortener with the full update of the FastAPI URL shortener tutorial - #926
Open
realpython-bot wants to merge 3 commits into
Open
realpython-bot wants to merge 3 commits into
realpython-bot wants to merge 3 commits into
Conversation
… Shortener With FastAPI and Python Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner With FastAPI and Python - SQLAlchemy 2.0 declarative models (DeclarativeBase, Mapped, mapped_column) - select()/Session.scalars() queries instead of the legacy Query API - Annotated[Session, Depends(get_db)] dependencies - Return type hints that admit None where the functions return None - Re-pinned requirements (fastapi 0.165.1, uvicorn 0.55.0, sqlalchemy 2.1.10, pydantic-settings 2.16.4), Python 3.11+ floor in the READMEs, README fixes
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync
fastapi-url-shortenerwith the full update draft of Build a URL Shortener With FastAPI and Python.What changed (second commit, on top of the October maintenance sync):
DeclarativeBase,Mapped[...],mapped_column()select()+Session.scalars()queries instead of the legacyQueryAPI;sessionmaker(autoflush=False, bind=engine)(theautocommitkeyword is legacy and must stayFalse)Annotated[Session, Depends(get_db)]Nonewhere the functions returnNone;update_db_clicks()takes amodels.URLrequirements.txtin all four step folders: fastapi 0.165.1, uvicorn 0.55.0, sqlalchemy 2.1.10, pydantic-settings 2.16.4, python-dotenv 1.2.4, validators 0.36.0Verified: every step folder run from the article's transcripts and a TestClient flow (create, forward, admin info, click count, delete, 404s) on Python 3.15.2 and 3.11.18 with
-W error(only upstream warnings ignored:fastapiimporting the deprecatedopentelemetry._logs, and Starlette's test client preferringhttpx2). Final app also exercised through a realuvicorn --reloadprocess with curl.ruff 0.14.1 format --checkandcheckclean;dircheck.pypasses.🤖 Generated with Claude Code