Repository navigation
Keep path_utils off PEP 604, which the 3.9 floor gate rejects - #9335
Merged
Merged
Conversation
`Core` has been failing on main at 'python floor compatibility (HARD GATE)', all three HF/TRL cells: 36 studio files now evaluate PEP 604 unions on the floor, up from 35 The 36th is studio/backend/utils/paths/path_utils.py, from #8919. That change is right; it just added subject_key: Callable[[str], object] | None = None to a module with no `from __future__ import annotations`, so the annotation is evaluated at import and `X | None` is a TypeError on the declared 3.9 floor. Uses Optional[...], which the module already imports, rather than adding the future import. Five other modules import this one, and deferring every annotation in it is a wider change than the one union needs -- the ratchet's own docstring warns that converting a file wants Studio booted, because FastAPI resolves annotations when it builds endpoints. Verified on main: offenders back to 35 against a debt of 35, the whole test_python39_compatibility.py suite passes (8), and the AppleDouble guards the original change added still pass (9).
danielhanchen
added a commit
that referenced
this pull request
Aug 20, 2026
The branch was 60 commits behind main, which is the only reason the stack was red: main has since fixed the four failure families this stack's CI was inheriting (#9342 for the sliced chat-adapter harness and the install.sh fallback range, #9348 for the two backend guards on the 3.13 leg, #9335 for the 3.9 union floor).
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.
Coreis failing on main at python floor compatibility (HARD GATE), on all three HF/TRL cells:The 36th is
studio/backend/utils/paths/path_utils.py, from #8919. That change is right - it just addedto a module with no
from __future__ import annotations, so the annotation is evaluated at import andX | Noneis aTypeErroron the declared 3.9 floor.Why Optional[...] and not the future import
The ratchet's message suggests adding
from __future__ import annotations, and that would work, but it is the wider change: five other modules import this one, and the ratchet's own docstring warns that converting a file wants Studio booted, because FastAPI resolves annotations when it builds each endpoint.Optionalis already imported in this file, so this touches one annotation and nothing else.Verified on main
tests/test_python39_compatibility.pystudio/backend/tests/test_appledouble_guards.pyReproduced locally before fixing: a checkout of
origin/maincounts 36, my branch point counted 35, and the diff is exactly this one file.