Skip to content

Commit 498d94d

Browse files
authored
change: update scikit-learn, scipy, and apache-airflow deps for dependabot (#4103)
1 parent 82b582a commit 498d94d

File tree

9 files changed

+27
-13
lines changed

9 files changed

+27
-13
lines changed

.githooks/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# this pre-push hook runs style checks and unit tests in python 3.6, 3.7, and 3.8 using tox.
2+
# this pre-push hook runs style checks and unit tests in python 3.8, 3.9, and 3.10 using tox.
33

44
set -e
55

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scipy==1.7.3
1+
scipy==1.10.1

requirements/extras/test_requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ awslogs==0.14.0
1212
black==22.3.0
1313
stopit==1.1.2
1414
# Update tox.ini to have correct version of airflow constraints file
15-
apache-airflow==2.6.3
15+
apache-airflow==2.7.0
1616
apache-airflow-providers-amazon==7.2.1
1717
attrs>=23.1.0,<24
1818
fabric==2.6.0
@@ -21,9 +21,9 @@ sagemaker-experiments==0.1.35
2121
Jinja2==3.0.3
2222
pyvis==0.2.1
2323
pandas>=1.3.5,<1.5
24-
scikit-learn==1.0.2
24+
scikit-learn==1.3.0
2525
cloudpickle==2.2.1
26-
scipy==1.7.3
26+
scipy==1.10.1
2727
urllib3>=1.26.8,<1.26.15
2828
docker>=5.0.2,<7.0.0
2929
PyYAML==6.0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def read_requirements(filename):
9292
url="https://github.com/aws/sagemaker-python-sdk/",
9393
license="Apache License 2.0",
9494
keywords="ML Amazon AWS AI Tensorflow MXNet",
95-
python_requires=">= 3.7",
95+
python_requires=">= 3.8",
9696
classifiers=[
9797
"Development Status :: 5 - Production/Stable",
9898
"Intended Audience :: Developers",
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
scipy==1.7.3
1+
scipy==1.10.1

tests/integ/sagemaker/experiments/test_run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def _generate_estimator(
693693
sagemaker_client_config=sagemaker_client_config,
694694
)
695695
return SKLearn(
696-
framework_version="0.23-1",
696+
framework_version="1.2-1",
697697
entry_point=_ENTRY_POINT_PATH,
698698
dependencies=[sdk_tar],
699699
role=execution_role,

tests/integ/sagemaker/remote_function/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"channels:\n"
8181
" - defaults\n"
8282
"dependencies:\n"
83-
" - scipy=1.7.3\n"
83+
" - scipy=1.10.1\n"
8484
" - pip:\n"
8585
" - /sagemaker-{sagemaker_version}.tar.gz\n"
8686
"prefix: /opt/conda/bin/conda\n"

tests/scripts/run-notebook-test.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,22 @@ for env in base /home/ec2-user/anaconda3/envs/*; do
5858
5959
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/activate "$env"'
6060
61+
if [ $env = base ]; then
62+
ENV_PYTHON=python
63+
else
64+
ENV_PYTHON="$env/bin/python"
65+
fi
66+
67+
PYTHON_VERSION=$($ENV_PYTHON -c"import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))")
68+
if [ $PYTHON_VERSION -lt 38 ]; then
69+
echo "Skipping because $env uses py$PYTHON_VERSION which is incompatible with SageMaker Python SDK"
70+
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
71+
continue
72+
fi
73+
6174
echo "Updating SageMaker Python SDK..."
62-
pip install --upgrade pip
63-
pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
75+
$ENV_PYTHON -m pip install --upgrade pip
76+
$ENV_PYTHON -m pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
6477
6578
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
6679

tests/unit/sagemaker/deserializers/test_deserializers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,9 @@ def test_numpy_deserializer_from_json(numpy_deserializer):
119119
# Sadly, ragged arrays work fine in JSON (giving us a 1D array of Python lists)
120120
def test_numpy_deserializer_from_json_ragged(numpy_deserializer):
121121
stream = io.BytesIO(b"[[1,2,3],\n[4,5,6,7]]")
122-
array = numpy_deserializer.deserialize(stream, "application/json")
123-
assert np.array_equal(array, np.array([[1, 2, 3], [4, 5, 6, 7]]))
122+
with pytest.raises(ValueError) as error:
123+
numpy_deserializer.deserialize(stream, "application/json")
124+
assert "requested array has an inhomogeneous shape" in str(error)
124125

125126

126127
def test_numpy_deserializer_from_json_alpha():

0 commit comments

Comments
 (0)