From 7bc6392dd10c83f5cb6614f29b33b9622285e5ef Mon Sep 17 00:00:00 2001 From: Eric Johnson <65414824+metrizable@users.noreply.github.com> Date: Wed, 10 Jun 2020 14:27:40 -0700 Subject: [PATCH] change: require framework_version, py_version for xgboost * small updates to docstrings * small updates to tests --- src/sagemaker/xgboost/estimator.py | 2 +- src/sagemaker/xgboost/model.py | 2 +- tests/integ/__init__.py | 2 +- tests/integ/test_airflow_config.py | 1 + tox.ini | 4 ++++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sagemaker/xgboost/estimator.py b/src/sagemaker/xgboost/estimator.py index 134235d829..67a446a8d1 100644 --- a/src/sagemaker/xgboost/estimator.py +++ b/src/sagemaker/xgboost/estimator.py @@ -85,7 +85,7 @@ def __init__( on SageMaker. For convenience, this accepts other types for keys and values, but ``str()`` will be called to convert them before training. py_version (str): Python version you want to use for executing your model - training code (default: 'py3'). One of 'py2' or 'py3'. + training code (default: 'py3'). image_name (str): If specified, the estimator will use this image for training and hosting, instead of selecting the appropriate SageMaker official image based on framework_version and py_version. It can be an ECR url or diff --git a/src/sagemaker/xgboost/model.py b/src/sagemaker/xgboost/model.py index aef85437fd..43ecc7d123 100644 --- a/src/sagemaker/xgboost/model.py +++ b/src/sagemaker/xgboost/model.py @@ -79,7 +79,7 @@ def __init__( image (str): A Docker image URI (default: None). If not specified, a default image for XGBoos will be used. py_version (str): Python version you want to use for executing your model training code - (default: 'py2'). + (default: 'py3'). framework_version (str): XGBoost version you want to use for executing your model training code. predictor_cls (callable[str, sagemaker.session.Session]): A function to call to create diff --git a/tests/integ/__init__.py b/tests/integ/__init__.py index 3ae638d103..9d90e78518 100644 --- a/tests/integ/__init__.py +++ b/tests/integ/__init__.py @@ -23,7 +23,7 @@ TUNING_DEFAULT_TIMEOUT_MINUTES = 20 TRANSFORM_DEFAULT_TIMEOUT_MINUTES = 20 AUTO_ML_DEFAULT_TIMEMOUT_MINUTES = 60 -PYTHON_VERSION = "py" + str(sys.version_info.major) +PYTHON_VERSION = "py{}".format(sys.version_info.major) # these regions have some p2 and p3 instances, but not enough for continuous testing HOSTING_NO_P2_REGIONS = [ diff --git a/tests/integ/test_airflow_config.py b/tests/integ/test_airflow_config.py index 95033a09eb..cecbbdd0ea 100644 --- a/tests/integ/test_airflow_config.py +++ b/tests/integ/test_airflow_config.py @@ -582,6 +582,7 @@ def test_tf_airflow_config_uploads_data_source_to_s3(sagemaker_session, cpu_inst @pytest.mark.canary_quick +@pytest.mark.skipif(PYTHON_VERSION == "py2", reason="XGBoost container does not support Python 2.") def test_xgboost_airflow_config_uploads_data_source_to_s3(sagemaker_session, cpu_instance_type): with timeout(seconds=AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS): xgboost = XGBoost( diff --git a/tox.ini b/tox.ini index 2c5a8f60c6..3495d1e444 100644 --- a/tox.ini +++ b/tox.ini @@ -66,6 +66,10 @@ commands = {env:IGNORE_COVERAGE:} coverage report --fail-under=86 extras = test +[testenv:py27] +setenv = + IGNORE_COVERAGE = true + [testenv:flake8] basepython = python3 skipdist = true