From c60773a7db8ce7a59d2cb5787dc90937776c0b8f Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Fri, 23 Jun 2023 16:40:03 -0700 Subject: [PATCH] fix: Fix aiplatform.init bug by replacing experiment_name with experiment PiperOrigin-RevId: 542988570 --- .../autologging_with_auto_run_creation_sample.py | 2 +- .../autologging_with_auto_run_creation_sample_test.py | 2 +- .../autologging_with_manual_run_creation_sample.py | 2 +- .../autologging_with_manual_run_creation_sample_test.py | 2 +- .../experiment_tracking/create_experiment_run_sample.py | 2 +- .../experiment_tracking/create_experiment_run_sample_test.py | 2 +- .../experiment_tracking/end_experiment_run_sample.py | 2 +- .../experiment_tracking/end_experiment_run_sample_test.py | 2 +- .../experiment_tracking/log_time_series_metrics_sample.py | 2 +- .../experiment_tracking/resume_experiment_run_sample.py | 2 +- .../experiment_tracking/resume_experiment_run_sample_test.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample.py b/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample.py index 88400ec240..e4f1c896af 100644 --- a/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample.py +++ b/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample.py @@ -25,7 +25,7 @@ def autologging_with_auto_run_creation_sample( location: str, ): aiplatform.init( - experiment_name=experiment_name, + experiment=experiment_name, project=project, location=location, experiment_tensorboard=experiment_tensorboard, diff --git a/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample_test.py b/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample_test.py index 7880a8fdf0..bc3e50d413 100644 --- a/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample_test.py +++ b/samples/model-builder/experiment_tracking/autologging_with_auto_run_creation_sample_test.py @@ -27,7 +27,7 @@ def test_autologging_with_auto_run_creation_sample(mock_sdk_init, mock_autolog): ) mock_sdk_init.assert_called_with( - experiment_name=constants.EXPERIMENT_NAME, + experiment=constants.EXPERIMENT_NAME, project=constants.PROJECT, location=constants.LOCATION, experiment_tensorboard=constants.TENSORBOARD_NAME, diff --git a/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample.py b/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample.py index 817a0c2a22..c41b1eb285 100644 --- a/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample.py +++ b/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample.py @@ -26,7 +26,7 @@ def autologging_with_manual_run_creation_sample( location: str, ): aiplatform.init( - experiment_name=experiment_name, + experiment=experiment_name, project=project, location=location, experiment_tensorboard=experiment_tensorboard, diff --git a/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample_test.py b/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample_test.py index 75765cc04d..e0a772a834 100644 --- a/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample_test.py +++ b/samples/model-builder/experiment_tracking/autologging_with_manual_run_creation_sample_test.py @@ -30,7 +30,7 @@ def test_autologging_with_manual_run_creation_sample( ) mock_sdk_init.assert_called_with( - experiment_name=constants.EXPERIMENT_NAME, + experiment=constants.EXPERIMENT_NAME, project=constants.PROJECT, location=constants.LOCATION, experiment_tensorboard=constants.TENSORBOARD_NAME, diff --git a/samples/model-builder/experiment_tracking/create_experiment_run_sample.py b/samples/model-builder/experiment_tracking/create_experiment_run_sample.py index 0767139eba..6e554d3b8b 100644 --- a/samples/model-builder/experiment_tracking/create_experiment_run_sample.py +++ b/samples/model-builder/experiment_tracking/create_experiment_run_sample.py @@ -25,7 +25,7 @@ def create_experiment_run_sample( project: str, location: str, ): - aiplatform.init(experiment_name=experiment_name, project=project, location=location) + aiplatform.init(experiment=experiment_name, project=project, location=location) aiplatform.start_run(run=run_name, tensorboard=experiment_run_tensorboard) diff --git a/samples/model-builder/experiment_tracking/create_experiment_run_sample_test.py b/samples/model-builder/experiment_tracking/create_experiment_run_sample_test.py index 1c91daecb7..93c938727f 100644 --- a/samples/model-builder/experiment_tracking/create_experiment_run_sample_test.py +++ b/samples/model-builder/experiment_tracking/create_experiment_run_sample_test.py @@ -27,7 +27,7 @@ def test_create_experiment_run_sample(mock_sdk_init, mock_start_run): ) mock_sdk_init.assert_called_with( - experiment_name=constants.EXPERIMENT_NAME, + experiment=constants.EXPERIMENT_NAME, project=constants.PROJECT, location=constants.LOCATION, ) diff --git a/samples/model-builder/experiment_tracking/end_experiment_run_sample.py b/samples/model-builder/experiment_tracking/end_experiment_run_sample.py index 5161c15937..3a4b3f9959 100644 --- a/samples/model-builder/experiment_tracking/end_experiment_run_sample.py +++ b/samples/model-builder/experiment_tracking/end_experiment_run_sample.py @@ -23,7 +23,7 @@ def end_experiment_run_sample( project: str, location: str, ): - aiplatform.init(experiment_name=experiment_name, project=project, location=location) + aiplatform.init(experiment=experiment_name, project=project, location=location) aiplatform.start_run(run=run_name, resume=True) diff --git a/samples/model-builder/experiment_tracking/end_experiment_run_sample_test.py b/samples/model-builder/experiment_tracking/end_experiment_run_sample_test.py index a28a18f1a3..72fe94c123 100644 --- a/samples/model-builder/experiment_tracking/end_experiment_run_sample_test.py +++ b/samples/model-builder/experiment_tracking/end_experiment_run_sample_test.py @@ -26,7 +26,7 @@ def test_end_experiment_run_sample(mock_sdk_init, mock_start_run, mock_end_run): ) mock_sdk_init.assert_called_with( - experiment_name=constants.EXPERIMENT_NAME, + experiment=constants.EXPERIMENT_NAME, project=constants.PROJECT, location=constants.LOCATION, ) diff --git a/samples/model-builder/experiment_tracking/log_time_series_metrics_sample.py b/samples/model-builder/experiment_tracking/log_time_series_metrics_sample.py index 2ab8d46d2f..70b80440fa 100644 --- a/samples/model-builder/experiment_tracking/log_time_series_metrics_sample.py +++ b/samples/model-builder/experiment_tracking/log_time_series_metrics_sample.py @@ -28,7 +28,7 @@ def log_time_series_metrics_sample( project: str, location: str, ): - aiplatform.init(experiment_name=experiment_name, project=project, location=location) + aiplatform.init(experiment=experiment_name, project=project, location=location) aiplatform.start_run(run_name=run_name, resume=True) diff --git a/samples/model-builder/experiment_tracking/resume_experiment_run_sample.py b/samples/model-builder/experiment_tracking/resume_experiment_run_sample.py index 6ba254f07f..3e2c0d779b 100644 --- a/samples/model-builder/experiment_tracking/resume_experiment_run_sample.py +++ b/samples/model-builder/experiment_tracking/resume_experiment_run_sample.py @@ -23,7 +23,7 @@ def resume_experiment_run_sample( project: str, location: str, ): - aiplatform.init(experiment_name=experiment_name, project=project, location=location) + aiplatform.init(experiment=experiment_name, project=project, location=location) aiplatform.start_run(run=run_name, resume=True) diff --git a/samples/model-builder/experiment_tracking/resume_experiment_run_sample_test.py b/samples/model-builder/experiment_tracking/resume_experiment_run_sample_test.py index 4cb5aa24fe..456cd5be78 100644 --- a/samples/model-builder/experiment_tracking/resume_experiment_run_sample_test.py +++ b/samples/model-builder/experiment_tracking/resume_experiment_run_sample_test.py @@ -26,7 +26,7 @@ def test_resume_experiment_run_sample(mock_sdk_init, mock_start_run): ) mock_sdk_init.assert_called_with( - experiment_name=constants.EXPERIMENT_NAME, + experiment=constants.EXPERIMENT_NAME, project=constants.PROJECT, location=constants.LOCATION, )