diff --git a/google/cloud/aiplatform/datasets/dataset.py b/google/cloud/aiplatform/datasets/dataset.py index 223a595f61..a564b507dc 100644 --- a/google/cloud/aiplatform/datasets/dataset.py +++ b/google/cloud/aiplatform/datasets/dataset.py @@ -106,7 +106,8 @@ def _validate_metadata_schema_uri(self) -> None: @classmethod def create( cls, - display_name: Optional[str], + # TODO(b/223262536): Make the display_name parameter optional in the next major release + display_name: str, metadata_schema_uri: str, gcs_source: Optional[Union[str, Sequence[str]]] = None, bq_source: Optional[str] = None, diff --git a/google/cloud/aiplatform/jobs.py b/google/cloud/aiplatform/jobs.py index 81dd3cd3b9..ce0325ef18 100644 --- a/google/cloud/aiplatform/jobs.py +++ b/google/cloud/aiplatform/jobs.py @@ -344,7 +344,8 @@ def completion_stats(self) -> Optional[gca_completion_stats.CompletionStats]: @classmethod def create( cls, - job_display_name: Optional[str], + # TODO(b/223262536): Make the job_display_name parameter optional in the next major release + job_display_name: str, model_name: Union[str, "aiplatform.Model"], instances_format: str = "jsonl", predictions_format: str = "jsonl", @@ -374,7 +375,7 @@ def create( Args: job_display_name (str): - Optional. The user-defined name of the BatchPredictionJob. + Required. The user-defined name of the BatchPredictionJob. The name can be up to 128 characters long and can be consist of any UTF-8 characters. model_name (Union[str, aiplatform.Model]): @@ -1013,7 +1014,7 @@ class CustomJob(_RunnableJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, worker_pool_specs: Union[List[Dict], List[aiplatform.gapic.WorkerPoolSpec]], base_output_dir: Optional[str] = None, project: Optional[str] = None, @@ -1059,7 +1060,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of the HyperparameterTuningJob. + Required. The user-defined name of the HyperparameterTuningJob. The name can be up to 128 characters long and can be consist of any UTF-8 characters. worker_pool_specs (Union[List[Dict], List[aiplatform.gapic.WorkerPoolSpec]]): @@ -1173,7 +1174,7 @@ def _log_web_access_uris(self): def from_local_script( cls, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, script_path: str, container_uri: str, args: Optional[Sequence[str]] = None, @@ -1216,7 +1217,7 @@ def from_local_script( Args: display_name (str): - Optional. The user-defined name of this CustomJob. + Required. The user-defined name of this CustomJob. script_path (str): Required. Local path to training script. container_uri (str): @@ -1493,7 +1494,7 @@ class HyperparameterTuningJob(_RunnableJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, custom_job: CustomJob, metric_spec: Dict[str, str], parameter_spec: Dict[str, hyperparameter_tuning._ParameterSpec], @@ -1567,7 +1568,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of the HyperparameterTuningJob. + Required. The user-defined name of the HyperparameterTuningJob. The name can be up to 128 characters long and can be consist of any UTF-8 characters. custom_job (aiplatform.CustomJob): diff --git a/google/cloud/aiplatform/pipeline_jobs.py b/google/cloud/aiplatform/pipeline_jobs.py index 8e4f4c832c..60acd553af 100644 --- a/google/cloud/aiplatform/pipeline_jobs.py +++ b/google/cloud/aiplatform/pipeline_jobs.py @@ -89,8 +89,9 @@ class PipelineJob(base.VertexAiResourceNounWithFutureManager): def __init__( self, + # TODO(b/223262536): Make the display_name parameter optional in the next major release + display_name: str, template_path: str, - display_name: Optional[str], job_id: Optional[str] = None, pipeline_root: Optional[str] = None, parameter_values: Optional[Dict[str, Any]] = None, @@ -106,7 +107,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of this Pipeline. + Required. The user-defined name of this Pipeline. template_path (str): Required. The path of PipelineJob or PipelineSpec JSON file. It can be a local path or a Google Cloud Storage URI. diff --git a/google/cloud/aiplatform/training_jobs.py b/google/cloud/aiplatform/training_jobs.py index c5dfa2711e..e904139efe 100644 --- a/google/cloud/aiplatform/training_jobs.py +++ b/google/cloud/aiplatform/training_jobs.py @@ -1016,7 +1016,7 @@ class _CustomTrainingJob(_TrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, container_uri: str, model_serving_container_image_uri: Optional[str] = None, model_serving_container_predict_route: Optional[str] = None, @@ -1040,7 +1040,7 @@ def __init__( """ Args: display_name (str): - Optional. The user-defined name of this TrainingPipeline. + Required. The user-defined name of this TrainingPipeline. container_uri (str): Required: Uri of the training container image in the GCR. model_serving_container_image_uri (str): @@ -1556,7 +1556,7 @@ class CustomTrainingJob(_CustomTrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, script_path: str, container_uri: str, requirements: Optional[Sequence[str]] = None, @@ -1616,7 +1616,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of this TrainingPipeline. + Required. The user-defined name of this TrainingPipeline. script_path (str): Required. Local path to training script. container_uri (str): Required: Uri of the training container image in the GCR. @@ -2388,7 +2388,7 @@ class CustomContainerTrainingJob(_CustomTrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, container_uri: str, command: Sequence[str] = None, model_serving_container_image_uri: Optional[str] = None, @@ -2446,7 +2446,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of this TrainingPipeline. + Required. The user-defined name of this TrainingPipeline. container_uri (str): Required: Uri of the training container image in the GCR. command (Sequence[str]): @@ -3197,7 +3197,7 @@ class AutoMLTabularTrainingJob(_TrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, optimization_prediction_type: str, optimization_objective: Optional[str] = None, column_specs: Optional[Dict[str, str]] = None, @@ -3225,7 +3225,7 @@ def __init__( Args: display_name (str): - Optional. The user-defined name of this TrainingPipeline. + Required. The user-defined name of this TrainingPipeline. optimization_prediction_type (str): The type of prediction the Model is to produce. "classification" - Predict one out of multiple target values is @@ -5005,7 +5005,7 @@ class CustomPythonPackageTrainingJob(_CustomTrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, python_package_gcs_uri: str, python_module_name: str, container_uri: str, @@ -6177,7 +6177,7 @@ class AutoMLTextTrainingJob(_TrainingJob): def __init__( self, # TODO(b/223262536): Make display_name parameter fully optional in next major release - display_name: Optional[str], + display_name: str, prediction_type: str, multi_label: bool = False, sentiment_max: int = 10,