fix(train): bound pydantic to <3.0.0 for cross-package consistency - #6363
Open
rsareddy0329 wants to merge 1 commit into
Open
rsareddy0329 wants to merge 1 commit into
rsareddy0329 wants to merge 1 commit into
Conversation
sagemaker-train declared pydantic>=2.0.0 with no upper bound, while sagemaker-core declares pydantic>=2.0.0,<3.0.0. Installing sagemaker-train on its own could therefore resolve a different pydantic major than the rest of the SDK allows. Align the bound so all sub-packages agree on the pydantic major, letting pip resolve a single consistent pydantic (and its matching, pydantic-managed pydantic-core). Note: pydantic-core is intentionally not pinned; pydantic pins its own exact pydantic-core, and pinning it here would fight that mechanism. Relates-to aws#5652
|
Claude finished @rsareddy0329's task in 33s —— View job PR Review: bound
|
lucasjia-aws
approved these changes
Sep 30, 2026
This branch was successfully 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.
Issue #, if available: Relates to #5652
Description of changes:
sagemaker-traindeclaredpydantic>=2.0.0with no upper bound, whilesagemaker-coredeclarespydantic>=2.0.0,<3.0.0. Installingsagemaker-trainon its own could therefore resolve a different
pydanticmajor than the rest ofthe SDK allows. This aligns the bound so all sub-packages agree on the
pydanticmajor, letting pip resolve a single consistent
pydantic(and its matching,pydantic-managed
pydantic-core).pydantic-coreis intentionally not pinned:pydanticpins its own exactpydantic-core, so pinning it here would fight that mechanism and cause moreconflicts, not fewer.
Scope note re #5652: the
SystemError: The installed pydantic-core version ... is incompatible with the current pydantic versionreported there comes fromupgrading
pydantic-coreindependently ofpydantic(e.g.pip install ... pydantic-core --force-reinstall --no-deps), which no dependencydeclaration can prevent. This change is the dependency-hygiene half of the fix —
it removes the version-skew gap between the sub-packages so a normal install lands
a consistent pair. Users who hit the mismatch after a manual
pydantic-coreupgrade should realign with
pip install --force-reinstall "pydantic>=2,<3".Testing:
sagemaker-train/pyproject.tomlparses and the productionpydanticconstraintnow matches
sagemaker-core(pydantic>=2.0.0,<3.0.0). Metadata-only change; noruntime code affected.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.