From 91d9c205235d6b6bcb690bc32620259791fc62d6 Mon Sep 17 00:00:00 2001 From: ivanmkc Date: Tue, 17 Aug 2021 00:56:36 -0400 Subject: [PATCH] Fixed tests/unit/aiplatform/test_automl_video_training_jobs.py --- google/cloud/aiplatform/training_jobs.py | 2 +- .../test_automl_video_training_jobs.py | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/google/cloud/aiplatform/training_jobs.py b/google/cloud/aiplatform/training_jobs.py index b006536898..29bcbfb639 100644 --- a/google/cloud/aiplatform/training_jobs.py +++ b/google/cloud/aiplatform/training_jobs.py @@ -5235,7 +5235,7 @@ def _run( training_task_inputs=training_task_inputs_dict, dataset=dataset, training_fraction_split=training_fraction_split, - validation_fraction_split=None, + validation_fraction_split=0, test_fraction_split=test_fraction_split, training_filter_split=training_filter_split, validation_filter_split="-", diff --git a/tests/unit/aiplatform/test_automl_video_training_jobs.py b/tests/unit/aiplatform/test_automl_video_training_jobs.py index fd07c3b54c..fd100ecfb1 100644 --- a/tests/unit/aiplatform/test_automl_video_training_jobs.py +++ b/tests/unit/aiplatform/test_automl_video_training_jobs.py @@ -58,10 +58,6 @@ _TEST_FILTER_SPLIT_VALIDATION = "-" _TEST_FILTER_SPLIT_TEST = "test" -_TEST_SPLIT_DEFAULT = gca_training_pipeline.FractionSplit( - training_fraction=0.8, validation_fraction=0.1, test_fraction=0.1, -) - _TEST_MODEL_NAME = ( f"projects/{_TEST_PROJECT}/locations/{_TEST_LOCATION}/models/{_TEST_MODEL_ID}" ) @@ -247,12 +243,6 @@ def test_init_aiplatform_with_encryption_key_name_and_create_training_job( if not sync: model_from_job.wait() - true_fraction_split = gca_training_pipeline.FractionSplit( - training_fraction=_TEST_FRACTION_SPLIT_TRAINING, - validation_fraction=_TEST_FRACTION_SPLIT_VALIDATION, - test_fraction=_TEST_FRACTION_SPLIT_TEST, - ) - true_managed_model = gca_model.Model( display_name=_TEST_MODEL_DISPLAY_NAME, description=mock_model._gca_resource.description, @@ -260,7 +250,7 @@ def test_init_aiplatform_with_encryption_key_name_and_create_training_job( ) true_input_data_config = gca_training_pipeline.InputDataConfig( - fraction_split=true_fraction_split, dataset_id=mock_dataset_video.name, + dataset_id=mock_dataset_video.name, ) true_training_pipeline = gca_training_pipeline.TrainingPipeline( @@ -453,8 +443,6 @@ def test_splits_default( if not sync: model_from_job.wait() - true_default_split = _TEST_SPLIT_DEFAULT - true_managed_model = gca_model.Model( display_name=_TEST_MODEL_DISPLAY_NAME, description=mock_model._gca_resource.description, @@ -462,7 +450,7 @@ def test_splits_default( ) true_input_data_config = gca_training_pipeline.InputDataConfig( - fraction_split=true_default_split, dataset_id=mock_dataset_video.name, + dataset_id=mock_dataset_video.name, ) true_training_pipeline = gca_training_pipeline.TrainingPipeline( @@ -646,7 +634,7 @@ def test_run_with_two_split_raises( model_display_name=_TEST_MODEL_DISPLAY_NAME, training_fraction_split=_TEST_FRACTION_SPLIT_TRAINING, test_fraction_split=_TEST_FRACTION_SPLIT_TEST, - training_filter_split=_TEST_FILTER_SPLIT_TRAINING, + training_filter_split=_TEST_FILTER_SPLIT_TEST, test_filter_split=_TEST_FILTER_SPLIT_TEST, sync=sync, )