Skip to content

Commit b92de52

Browse files
rsareddy0329Roja Reddy Sareddy
andauthored
fix(serve): pin pandas below 3.1.0 to unblock serve unit tests (#6524)
* fix(serve): pin pandas to 2.x in test extra to unblock unit tests The sagemaker-serve unit-tests job runs py310/py311/py312 tox envs. pandas is pulled in transitively (via mlflow) and is unpinned, so pip resolves the newly released pandas 3.1.0 on py311/py312 (3.x requires Python >=3.11). That build leaves the C extensions unbuilt in CI ("ImportError: C extension: None not built"), so pytest fails at collection and the whole job goes red — even though py310 (pandas 2.3.3) passes all tests. This is environment/dependency churn, unrelated to any product change. Pin pandas to the 2.x line in the test extra so all three envs resolve the known-good 2.3.3 (what py310 already uses). Verified locally: `pandas>=2.3.0,<3` resolves to 2.3.3 and imports cleanly on Python 3.12. * fix(serve): cap pandas below 3.1.0 (last-known-good 3.0.6) Refine the pin to the last-known-good state: before pandas 3.1.0 was released, the py311/py312 unit-test envs resolved pandas 3.0.6 and passed; py310 resolves 2.3.3 (pandas 3.x requires Python >=3.11). 3.1.0's wheels are built against a newer NumPy C-ABI than those envs resolve, so it fails to import at collection. `>=2.3.0,<3.1.0` restores py311/py312 to 3.0.6 and keeps py310 on 2.3.3 -- exactly the configuration that was green before the 3.1.0 release. A hard ==3.0.6 is intentionally avoided because it would break the py310 env. --------- Co-authored-by: Roja Reddy Sareddy <rsareddy@amazon.com>
1 parent aa37a9b commit b92de52

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎sagemaker-serve/pyproject.toml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ test = [
6969
"onnxruntime",
7070
"torch>=2.0.0",
7171
"tritonclient[http]",
72+
# pandas is pulled in transitively (e.g. via mlflow). Cap below 3.1.0:
73+
# pandas 3.1.0 ships wheels built against a newer NumPy C-ABI than the
74+
# py311/py312 test envs resolve, so it fails to import ("ImportError:
75+
# C extension: None not built") at pytest collection time. The previous
76+
# release 3.0.6 was passing on py311/py312; py310 stays on the 2.x line
77+
# (2.3.3) because pandas 3.x requires Python >=3.11.
78+
"pandas>=2.3.0,<3.1.0",
7279
]
7380
dev = [
7481
"pytest",

0 commit comments

Comments
 (0)