@pytest.mark.skipif((tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS), reason='AutoML is not supported in the region yet.')
def test_auto_ml_invalid_target_attribute(sagemaker_session):
    auto_ml = AutoML(role=ROLE, target_attribute_name='y', sagemaker_session=sagemaker_session, max_candidates=1)
    job_name = unique_name_from_base('auto-ml', max_length=32)
    inputs = sagemaker_session.upload_data(path=TRAINING_DATA, key_prefix=(PREFIX + '/input'))
    with pytest.raises(ClientError, match='An error occurred \\(ValidationException\\) when calling the CreateAutoMLJob operation: Target attribute name y does not exist in header.'):
        auto_ml.fit(inputs, job_name=job_name)
@pytest.mark.skipif((tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS), reason='AutoML is not supported in the region yet.')
def test_auto_ml_invalid_target_attribute(sagemaker_session):
    auto_ml = AutoML(role=ROLE, target_attribute_name='y', sagemaker_session=sagemaker_session, max_candidates=1)
    job_name = unique_name_from_base('auto-ml', max_length=32)
    inputs = sagemaker_session.upload_data(path=TRAINING_DATA, key_prefix=(PREFIX + '/input'))
    with pytest.raises(ClientError, match='An error occurred \\(ValidationException\\) when calling the CreateAutoMLJob operation: Target attribute name y does not exist in header.'):
        auto_ml.fit(inputs, job_name=job_name)