Skip to content

fix: [Bug]: PySDK V3: pydantic-core (2.42.0) incompatibility with sagemaker.ai_regist (5652)#5728

Draft
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/bug-pysdk-v3-pydantic-core-2-42-0-incompatibility-5652
Draft

fix: [Bug]: PySDK V3: pydantic-core (2.42.0) incompatibility with sagemaker.ai_regist (5652)#5728
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/bug-pysdk-v3-pydantic-core-2-42-0-incompatibility-5652

Conversation

@aviruthen
Copy link
Copy Markdown
Collaborator

Description

The issue is a pydantic/pydantic-core version incompatibility. sagemaker-core declares 'pydantic>=2.0.0,<3.0.0' as a dependency but does NOT declare pydantic-core. Pydantic requires an exact matching pydantic-core version (e.g., pydantic 2.11.5 requires pydantic-core==2.41.5). When users run 'pip install --force-reinstall', pip may resolve pydantic-core to a newer version (e.g., 2.42.0) that is incompatible with the installed pydantic version. This causes a SystemError at import time when any module transitively imports pydantic (e.g., DataSet → session_helper → pydantic). The fix is to either: (1) add pydantic-core as a dependency that will be co-resolved with pydantic, or (2) tighten pydantic constraints. The best approach is to let pydantic manage its own pydantic-core dependency but also exclude known-incompatible pydantic-core versions, plus add a runtime compatibility check that provides a helpful error message.

Related Issue

Related issue: 5652

Changes Made

  • sagemaker-core/pyproject.toml
  • sagemaker-core/src/sagemaker/core/_pydantic_compat.py
  • sagemaker-core/src/sagemaker/core/__init__.py
  • sagemaker-core/tests/unit/test_pydantic_compat.py

AI-Generated PR

This PR was automatically generated by the PySDK Issue Agent.

  • Confidence score: 85%
  • Classification: bug
  • SDK version target: V3

Merge Checklist

  • Changes are backward compatible
  • Commit message follows prefix: description format
  • Unit tests added/updated
  • Integration tests added (if applicable)
  • Documentation updated (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant