diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/async_client.py b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/async_client.py index 063b67dcbb5c..b85bc89decca 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/async_client.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/async_client.py @@ -94,6 +94,12 @@ class DataformAsyncClient: parse_crypto_key_version_path = staticmethod( DataformClient.parse_crypto_key_version_path ) + notebook_runtime_template_path = staticmethod( + DataformClient.notebook_runtime_template_path + ) + parse_notebook_runtime_template_path = staticmethod( + DataformClient.parse_notebook_runtime_template_path + ) release_config_path = staticmethod(DataformClient.release_config_path) parse_release_config_path = staticmethod(DataformClient.parse_release_config_path) repository_path = staticmethod(DataformClient.repository_path) @@ -323,6 +329,10 @@ async def list_repositories( ) -> pagers.ListRepositoriesAsyncPager: r"""Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -685,13 +695,11 @@ async def update_repository( ) -> dataform.Repository: r"""Updates a single Repository. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -3780,13 +3788,11 @@ async def update_release_config( ) -> dataform.ReleaseConfig: r"""Updates a single ReleaseConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -4844,13 +4850,11 @@ async def update_workflow_config( ) -> dataform.WorkflowConfig: r"""Updates a single WorkflowConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -5827,13 +5831,11 @@ async def update_config( ) -> dataform.Config: r"""Update default config for a given project and location. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/client.py b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/client.py index 4d05cc6a4bbc..b27ef5516288 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/client.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/client.py @@ -296,6 +296,28 @@ def parse_crypto_key_version_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def notebook_runtime_template_path( + project: str, + location: str, + notebook_runtime_template: str, + ) -> str: + """Returns a fully-qualified notebook_runtime_template string.""" + return "projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}".format( + project=project, + location=location, + notebook_runtime_template=notebook_runtime_template, + ) + + @staticmethod + def parse_notebook_runtime_template_path(path: str) -> Dict[str, str]: + """Parses a notebook_runtime_template path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/notebookRuntimeTemplates/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def release_config_path( project: str, @@ -938,6 +960,10 @@ def list_repositories( ) -> pagers.ListRepositoriesPager: r"""Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1291,13 +1317,11 @@ def update_repository( ) -> dataform.Repository: r"""Updates a single Repository. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -4319,13 +4343,11 @@ def update_release_config( ) -> dataform.ReleaseConfig: r"""Updates a single ReleaseConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -5361,13 +5383,11 @@ def update_workflow_config( ) -> dataform.WorkflowConfig: r"""Updates a single WorkflowConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -6329,13 +6349,11 @@ def update_config( ) -> dataform.Config: r"""Update default config for a given project and location. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc.py b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc.py index cf3aa4e27bbe..b4b5c2ad5979 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc.py @@ -334,6 +334,10 @@ def list_repositories( Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + Returns: Callable[[~.ListRepositoriesRequest], ~.ListRepositoriesResponse]: @@ -413,13 +417,11 @@ def update_repository( Updates a single Repository. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateRepositoryRequest], @@ -1306,13 +1308,11 @@ def update_release_config( Updates a single ReleaseConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateReleaseConfigRequest], @@ -1563,13 +1563,11 @@ def update_workflow_config( Updates a single WorkflowConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateWorkflowConfigRequest], @@ -1826,13 +1824,11 @@ def update_config( Update default config for a given project and location. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateConfigRequest], diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc_asyncio.py b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc_asyncio.py index 19a41a44ee8f..39b5ff0b81de 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc_asyncio.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1/services/dataform/transports/grpc_asyncio.py @@ -342,6 +342,10 @@ def list_repositories( Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + Returns: Callable[[~.ListRepositoriesRequest], Awaitable[~.ListRepositoriesResponse]]: @@ -421,13 +425,11 @@ def update_repository( Updates a single Repository. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateRepositoryRequest], @@ -1343,13 +1345,11 @@ def update_release_config( Updates a single ReleaseConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateReleaseConfigRequest], @@ -1609,13 +1609,11 @@ def update_workflow_config( Updates a single WorkflowConfig. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateWorkflowConfigRequest], @@ -1879,13 +1877,11 @@ def update_config( Update default config for a given project and location. - **Note:** *This method does not fully implement*, (see - `AIP/134 `__, in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateConfigRequest], diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1/types/dataform.py b/packages/google-cloud-dataform/google/cloud/dataform_v1/types/dataform.py index b650a7ab89e3..313c1bde0f0b 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1/types/dataform.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1/types/dataform.py @@ -2445,6 +2445,9 @@ class CodeCompilationConfig(proto.Message): table_prefix (str): Optional. The prefix that should be prepended to all table names. + builtin_assertion_name_prefix (str): + Optional. The prefix to prepend to built-in + assertion names. default_notebook_runtime_options (google.cloud.dataform_v1.types.NotebookRuntimeOptions): Optional. The default notebook runtime options. @@ -2483,6 +2486,10 @@ class CodeCompilationConfig(proto.Message): proto.STRING, number=7, ) + builtin_assertion_name_prefix: str = proto.Field( + proto.STRING, + number=10, + ) default_notebook_runtime_options: "NotebookRuntimeOptions" = proto.Field( proto.MESSAGE, number=9, @@ -2501,6 +2508,12 @@ class NotebookRuntimeOptions(proto.Message): result to. Format: ``gs://bucket-name``. This field is a member of `oneof`_ ``execution_sink``. + ai_platform_notebook_runtime_template (str): + Optional. The resource name of the [Colab runtime template] + (https://cloud.google.com/colab/docs/runtimes), from which a + runtime is created for notebook executions. If not + specified, a runtime is created with Colab's default + specifications. """ gcs_output_bucket: str = proto.Field( @@ -2508,6 +2521,10 @@ class NotebookRuntimeOptions(proto.Message): number=1, oneof="execution_sink", ) + ai_platform_notebook_runtime_template: str = proto.Field( + proto.STRING, + number=2, + ) class ListCompilationResultsRequest(proto.Message): @@ -2752,6 +2769,10 @@ class CompilationResultAction(proto.Message): notebook (google.cloud.dataform_v1.types.CompilationResultAction.Notebook): The notebook executed by this action. + This field is a member of `oneof`_ ``compiled_object``. + data_preparation (google.cloud.dataform_v1.types.CompilationResultAction.DataPreparation): + The data preparation executed by this action. + This field is a member of `oneof`_ ``compiled_object``. target (google.cloud.dataform_v1.types.Target): This action's identifier. Unique within the @@ -3113,6 +3134,191 @@ class Notebook(proto.Message): number=4, ) + class DataPreparation(proto.Message): + r"""Defines a compiled Data Preparation entity + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + contents_yaml (str): + The data preparation definition, stored as a + YAML string. + + This field is a member of `oneof`_ ``definition``. + contents_sql (google.cloud.dataform_v1.types.CompilationResultAction.DataPreparation.SqlDefinition): + SQL definition for a Data Preparation. + Contains a SQL query and additional context + information. + + This field is a member of `oneof`_ ``definition``. + dependency_targets (MutableSequence[google.cloud.dataform_v1.types.Target]): + A list of actions that this action depends + on. + disabled (bool): + Whether this action is disabled (i.e. should + not be run). + tags (MutableSequence[str]): + Arbitrary, user-defined tags on this action. + """ + + class SqlDefinition(proto.Message): + r"""Definition of a SQL Data Preparation + + Attributes: + query (str): + The SQL query representing the data + preparation steps. Formatted as a Pipe SQL query + statement. + error_table (google.cloud.dataform_v1.types.CompilationResultAction.DataPreparation.ErrorTable): + Error table configuration, + load (google.cloud.dataform_v1.types.CompilationResultAction.LoadConfig): + Load configuration. + """ + + query: str = proto.Field( + proto.STRING, + number=1, + ) + error_table: "CompilationResultAction.DataPreparation.ErrorTable" = ( + proto.Field( + proto.MESSAGE, + number=2, + message="CompilationResultAction.DataPreparation.ErrorTable", + ) + ) + load: "CompilationResultAction.LoadConfig" = proto.Field( + proto.MESSAGE, + number=3, + message="CompilationResultAction.LoadConfig", + ) + + class ErrorTable(proto.Message): + r"""Error table information, used to write error data into a + BigQuery table. + + Attributes: + target (google.cloud.dataform_v1.types.Target): + Error Table target. + retention_days (int): + Error table partition expiration in days. + Only positive values are allowed. + """ + + target: "Target" = proto.Field( + proto.MESSAGE, + number=1, + message="Target", + ) + retention_days: int = proto.Field( + proto.INT32, + number=2, + ) + + contents_yaml: str = proto.Field( + proto.STRING, + number=5, + oneof="definition", + ) + contents_sql: "CompilationResultAction.DataPreparation.SqlDefinition" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="definition", + message="CompilationResultAction.DataPreparation.SqlDefinition", + ) + ) + dependency_targets: MutableSequence["Target"] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Target", + ) + disabled: bool = proto.Field( + proto.BOOL, + number=2, + ) + tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=4, + ) + + class LoadConfig(proto.Message): + r"""Simplified load configuration for actions + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + replace (google.cloud.dataform_v1.types.CompilationResultAction.SimpleLoadMode): + Replace destination table + + This field is a member of `oneof`_ ``mode``. + append (google.cloud.dataform_v1.types.CompilationResultAction.SimpleLoadMode): + Append into destination table + + This field is a member of `oneof`_ ``mode``. + maximum (google.cloud.dataform_v1.types.CompilationResultAction.IncrementalLoadMode): + Insert records where the value exceeds the + previous maximum value for a column in the + destination table + + This field is a member of `oneof`_ ``mode``. + unique (google.cloud.dataform_v1.types.CompilationResultAction.IncrementalLoadMode): + Insert records where the value of a column is + not already present in the destination table + + This field is a member of `oneof`_ ``mode``. + """ + + replace: "CompilationResultAction.SimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=1, + oneof="mode", + message="CompilationResultAction.SimpleLoadMode", + ) + append: "CompilationResultAction.SimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=2, + oneof="mode", + message="CompilationResultAction.SimpleLoadMode", + ) + maximum: "CompilationResultAction.IncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=3, + oneof="mode", + message="CompilationResultAction.IncrementalLoadMode", + ) + unique: "CompilationResultAction.IncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=4, + oneof="mode", + message="CompilationResultAction.IncrementalLoadMode", + ) + + class SimpleLoadMode(proto.Message): + r"""Simple load definition""" + + class IncrementalLoadMode(proto.Message): + r"""Load definition for incremental load modes + + Attributes: + column (str): + Column name for incremental load modes + """ + + column: str = proto.Field( + proto.STRING, + number=1, + ) + relation: Relation = proto.Field( proto.MESSAGE, number=4, @@ -3143,6 +3349,12 @@ class Notebook(proto.Message): oneof="compiled_object", message=Notebook, ) + data_preparation: DataPreparation = proto.Field( + proto.MESSAGE, + number=9, + oneof="compiled_object", + message=DataPreparation, + ) target: "Target" = proto.Field( proto.MESSAGE, number=1, @@ -3266,6 +3478,9 @@ class WorkflowConfig(proto.Message): execution attempts, ordered in descending order of ``execution_time``. Updated whenever automatic creation of a workflow invocation is triggered by cron_schedule. + disabled (bool): + Optional. Disables automatic creation of + workflow invocations. create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The timestamp of when the WorkflowConfig was created. @@ -3355,6 +3570,10 @@ class ScheduledExecutionRecord(proto.Message): number=5, message=ScheduledExecutionRecord, ) + disabled: bool = proto.Field( + proto.BOOL, + number=8, + ) create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, @@ -3881,6 +4100,11 @@ class WorkflowInvocationAction(proto.Message): Output only. The workflow action's notebook action details. + This field is a member of `oneof`_ ``action``. + data_preparation_action (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction): + Output only. The workflow action's data + preparation action details. + This field is a member of `oneof`_ ``action``. target (google.cloud.dataform_v1.types.Target): Output only. This action's identifier. Unique @@ -3987,6 +4211,183 @@ class NotebookAction(proto.Message): number=2, ) + class DataPreparationAction(proto.Message): + r"""Represents a workflow action that will run a Data + Preparation. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + contents_yaml (str): + Output only. YAML representing the contents + of the data preparation. Can be used to show the + customer what the input was to their workflow. + + This field is a member of `oneof`_ ``definition``. + contents_sql (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition): + SQL definition for a Data Preparation. + Contains a SQL query and additional context + information. + + This field is a member of `oneof`_ ``definition``. + generated_sql (str): + Output only. The generated BigQuery SQL + script that will be executed. For reference + only. + job_id (str): + Output only. The ID of the BigQuery job that executed the + SQL in sql_script. Only set once the job has started to run. + """ + + class ActionSqlDefinition(proto.Message): + r"""Definition of a SQL Data Preparation + + Attributes: + query (str): + The SQL query representing the data + preparation steps. Formatted as a Pipe SQL query + statement. + error_table (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable): + Error table configuration, + load_config (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig): + Load configuration. + """ + + query: str = proto.Field( + proto.STRING, + number=1, + ) + error_table: "WorkflowInvocationAction.DataPreparationAction.ActionErrorTable" = proto.Field( + proto.MESSAGE, + number=2, + message="WorkflowInvocationAction.DataPreparationAction.ActionErrorTable", + ) + load_config: "WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig" = proto.Field( + proto.MESSAGE, + number=3, + message="WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig", + ) + + class ActionErrorTable(proto.Message): + r"""Error table information, used to write error data into a + BigQuery table. + + Attributes: + target (google.cloud.dataform_v1.types.Target): + Error Table target. + retention_days (int): + Error table partition expiration in days. + Only positive values are allowed. + """ + + target: "Target" = proto.Field( + proto.MESSAGE, + number=1, + message="Target", + ) + retention_days: int = proto.Field( + proto.INT32, + number=2, + ) + + class ActionLoadConfig(proto.Message): + r"""Simplified load configuration for actions + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + replace (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode): + Replace destination table + + This field is a member of `oneof`_ ``mode``. + append (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode): + Append into destination table + + This field is a member of `oneof`_ ``mode``. + maximum (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode): + Insert records where the value exceeds the + previous maximum value for a column in the + destination table + + This field is a member of `oneof`_ ``mode``. + unique (google.cloud.dataform_v1.types.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode): + Insert records where the value of a column is + not already present in the destination table + + This field is a member of `oneof`_ ``mode``. + """ + + replace: "WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=1, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode", + ) + append: "WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=2, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode", + ) + maximum: "WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=3, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode", + ) + unique: "WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=4, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode", + ) + + class ActionSimpleLoadMode(proto.Message): + r"""Simple load definition""" + + class ActionIncrementalLoadMode(proto.Message): + r"""Load definition for incremental load modes + + Attributes: + column (str): + Column name for incremental load modes + """ + + column: str = proto.Field( + proto.STRING, + number=1, + ) + + contents_yaml: str = proto.Field( + proto.STRING, + number=2, + oneof="definition", + ) + contents_sql: "WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition" = proto.Field( + proto.MESSAGE, + number=6, + oneof="definition", + message="WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition", + ) + generated_sql: str = proto.Field( + proto.STRING, + number=3, + ) + job_id: str = proto.Field( + proto.STRING, + number=4, + ) + bigquery_action: BigQueryAction = proto.Field( proto.MESSAGE, number=6, @@ -3999,6 +4400,12 @@ class NotebookAction(proto.Message): oneof="action", message=NotebookAction, ) + data_preparation_action: DataPreparationAction = proto.Field( + proto.MESSAGE, + number=9, + oneof="action", + message=DataPreparationAction, + ) target: "Target" = proto.Field( proto.MESSAGE, number=1, diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/async_client.py b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/async_client.py index 941ddfee3f55..0827a5ba5186 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/async_client.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/async_client.py @@ -94,6 +94,12 @@ class DataformAsyncClient: parse_crypto_key_version_path = staticmethod( DataformClient.parse_crypto_key_version_path ) + notebook_runtime_template_path = staticmethod( + DataformClient.notebook_runtime_template_path + ) + parse_notebook_runtime_template_path = staticmethod( + DataformClient.parse_notebook_runtime_template_path + ) release_config_path = staticmethod(DataformClient.release_config_path) parse_release_config_path = staticmethod(DataformClient.parse_release_config_path) repository_path = staticmethod(DataformClient.repository_path) @@ -323,6 +329,10 @@ async def list_repositories( ) -> pagers.ListRepositoriesAsyncPager: r"""Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -685,13 +695,11 @@ async def update_repository( ) -> dataform.Repository: r"""Updates a single Repository. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -3780,13 +3788,11 @@ async def update_release_config( ) -> dataform.ReleaseConfig: r"""Updates a single ReleaseConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -4844,13 +4850,11 @@ async def update_workflow_config( ) -> dataform.WorkflowConfig: r"""Updates a single WorkflowConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -5827,13 +5831,11 @@ async def update_config( ) -> dataform.Config: r"""Update default config for a given project and location. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/client.py b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/client.py index 5da0443f1f8d..079d8d70cb2c 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/client.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/client.py @@ -296,6 +296,28 @@ def parse_crypto_key_version_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def notebook_runtime_template_path( + project: str, + location: str, + notebook_runtime_template: str, + ) -> str: + """Returns a fully-qualified notebook_runtime_template string.""" + return "projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}".format( + project=project, + location=location, + notebook_runtime_template=notebook_runtime_template, + ) + + @staticmethod + def parse_notebook_runtime_template_path(path: str) -> Dict[str, str]: + """Parses a notebook_runtime_template path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/notebookRuntimeTemplates/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def release_config_path( project: str, @@ -938,6 +960,10 @@ def list_repositories( ) -> pagers.ListRepositoriesPager: r"""Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1291,13 +1317,11 @@ def update_repository( ) -> dataform.Repository: r"""Updates a single Repository. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -4319,13 +4343,11 @@ def update_release_config( ) -> dataform.ReleaseConfig: r"""Updates a single ReleaseConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -5361,13 +5383,11 @@ def update_workflow_config( ) -> dataform.WorkflowConfig: r"""Updates a single WorkflowConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python @@ -6329,13 +6349,11 @@ def update_config( ) -> dataform.Config: r"""Update default config for a given project and location. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* .. code-block:: python diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py index 4111302f4e56..e8feecb86c00 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc.py @@ -334,6 +334,10 @@ def list_repositories( Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + Returns: Callable[[~.ListRepositoriesRequest], ~.ListRepositoriesResponse]: @@ -413,13 +417,11 @@ def update_repository( Updates a single Repository. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateRepositoryRequest], @@ -1306,13 +1308,11 @@ def update_release_config( Updates a single ReleaseConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateReleaseConfigRequest], @@ -1563,13 +1563,11 @@ def update_workflow_config( Updates a single WorkflowConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateWorkflowConfigRequest], @@ -1826,13 +1824,11 @@ def update_config( Update default config for a given project and location. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateConfigRequest], diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py index ba7f48f9e0b9..0a9751e26d42 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/services/dataform/transports/grpc_asyncio.py @@ -342,6 +342,10 @@ def list_repositories( Lists Repositories in a given project and location. + **Note:** *This method can return repositories not shown in + the*\ `Dataform + UI `__. + Returns: Callable[[~.ListRepositoriesRequest], Awaitable[~.ListRepositoriesResponse]]: @@ -421,13 +425,11 @@ def update_repository( Updates a single Repository. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateRepositoryRequest], @@ -1343,13 +1345,11 @@ def update_release_config( Updates a single ReleaseConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateReleaseConfigRequest], @@ -1609,13 +1609,11 @@ def update_workflow_config( Updates a single WorkflowConfig. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateWorkflowConfigRequest], @@ -1879,13 +1877,11 @@ def update_config( Update default config for a given project and location. - **Note:** This method does not fully implement - `AIP-134 `__; in particular: - - - The wildcard entry (**\***) is treated as a bad request - - When the **field_mask** is omitted, instead of only updating - the set fields, the request is treated as a full update on - all modifiable fields + **Note:** *This method does not fully + implement*\ `AIP/134 `__\ *. The + wildcard entry (*) is treated as a bad request, and when the + ``field_mask`` is omitted, the request is treated as a full + update on all modifiable fields.* Returns: Callable[[~.UpdateConfigRequest], diff --git a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/types/dataform.py b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/types/dataform.py index d39142333dc4..f59b9c9f37c0 100644 --- a/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/types/dataform.py +++ b/packages/google-cloud-dataform/google/cloud/dataform_v1beta1/types/dataform.py @@ -2457,6 +2457,9 @@ class CodeCompilationConfig(proto.Message): table_prefix (str): Optional. The prefix that should be prepended to all table names. + builtin_assertion_name_prefix (str): + Optional. The prefix to prepend to built-in + assertion names. default_notebook_runtime_options (google.cloud.dataform_v1beta1.types.NotebookRuntimeOptions): Optional. The default notebook runtime options. @@ -2495,6 +2498,10 @@ class CodeCompilationConfig(proto.Message): proto.STRING, number=7, ) + builtin_assertion_name_prefix: str = proto.Field( + proto.STRING, + number=10, + ) default_notebook_runtime_options: "NotebookRuntimeOptions" = proto.Field( proto.MESSAGE, number=9, @@ -2513,6 +2520,12 @@ class NotebookRuntimeOptions(proto.Message): result to. Format: ``gs://bucket-name``. This field is a member of `oneof`_ ``execution_sink``. + ai_platform_notebook_runtime_template (str): + Optional. The resource name of the [Colab runtime template] + (https://cloud.google.com/colab/docs/runtimes), from which a + runtime is created for notebook executions. If not + specified, a runtime is created with Colab's default + specifications. """ gcs_output_bucket: str = proto.Field( @@ -2520,6 +2533,10 @@ class NotebookRuntimeOptions(proto.Message): number=1, oneof="execution_sink", ) + ai_platform_notebook_runtime_template: str = proto.Field( + proto.STRING, + number=2, + ) class ListCompilationResultsRequest(proto.Message): @@ -2764,6 +2781,10 @@ class CompilationResultAction(proto.Message): notebook (google.cloud.dataform_v1beta1.types.CompilationResultAction.Notebook): The notebook executed by this action. + This field is a member of `oneof`_ ``compiled_object``. + data_preparation (google.cloud.dataform_v1beta1.types.CompilationResultAction.DataPreparation): + The data preparation executed by this action. + This field is a member of `oneof`_ ``compiled_object``. target (google.cloud.dataform_v1beta1.types.Target): This action's identifier. Unique within the @@ -3125,6 +3146,191 @@ class Notebook(proto.Message): number=4, ) + class DataPreparation(proto.Message): + r"""Defines a compiled Data Preparation entity + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + contents_yaml (str): + The data preparation definition, stored as a + YAML string. + + This field is a member of `oneof`_ ``definition``. + contents_sql (google.cloud.dataform_v1beta1.types.CompilationResultAction.DataPreparation.SqlDefinition): + SQL definition for a Data Preparation. + Contains a SQL query and additional context + information. + + This field is a member of `oneof`_ ``definition``. + dependency_targets (MutableSequence[google.cloud.dataform_v1beta1.types.Target]): + A list of actions that this action depends + on. + disabled (bool): + Whether this action is disabled (i.e. should + not be run). + tags (MutableSequence[str]): + Arbitrary, user-defined tags on this action. + """ + + class SqlDefinition(proto.Message): + r"""Definition of a SQL Data Preparation + + Attributes: + query (str): + The SQL query representing the data + preparation steps. Formatted as a Pipe SQL query + statement. + error_table (google.cloud.dataform_v1beta1.types.CompilationResultAction.DataPreparation.ErrorTable): + Error table configuration, + load (google.cloud.dataform_v1beta1.types.CompilationResultAction.LoadConfig): + Load configuration. + """ + + query: str = proto.Field( + proto.STRING, + number=1, + ) + error_table: "CompilationResultAction.DataPreparation.ErrorTable" = ( + proto.Field( + proto.MESSAGE, + number=2, + message="CompilationResultAction.DataPreparation.ErrorTable", + ) + ) + load: "CompilationResultAction.LoadConfig" = proto.Field( + proto.MESSAGE, + number=3, + message="CompilationResultAction.LoadConfig", + ) + + class ErrorTable(proto.Message): + r"""Error table information, used to write error data into a + BigQuery table. + + Attributes: + target (google.cloud.dataform_v1beta1.types.Target): + Error Table target. + retention_days (int): + Error table partition expiration in days. + Only positive values are allowed. + """ + + target: "Target" = proto.Field( + proto.MESSAGE, + number=1, + message="Target", + ) + retention_days: int = proto.Field( + proto.INT32, + number=2, + ) + + contents_yaml: str = proto.Field( + proto.STRING, + number=5, + oneof="definition", + ) + contents_sql: "CompilationResultAction.DataPreparation.SqlDefinition" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="definition", + message="CompilationResultAction.DataPreparation.SqlDefinition", + ) + ) + dependency_targets: MutableSequence["Target"] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="Target", + ) + disabled: bool = proto.Field( + proto.BOOL, + number=2, + ) + tags: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=4, + ) + + class LoadConfig(proto.Message): + r"""Simplified load configuration for actions + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + replace (google.cloud.dataform_v1beta1.types.CompilationResultAction.SimpleLoadMode): + Replace destination table + + This field is a member of `oneof`_ ``mode``. + append (google.cloud.dataform_v1beta1.types.CompilationResultAction.SimpleLoadMode): + Append into destination table + + This field is a member of `oneof`_ ``mode``. + maximum (google.cloud.dataform_v1beta1.types.CompilationResultAction.IncrementalLoadMode): + Insert records where the value exceeds the + previous maximum value for a column in the + destination table + + This field is a member of `oneof`_ ``mode``. + unique (google.cloud.dataform_v1beta1.types.CompilationResultAction.IncrementalLoadMode): + Insert records where the value of a column is + not already present in the destination table + + This field is a member of `oneof`_ ``mode``. + """ + + replace: "CompilationResultAction.SimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=1, + oneof="mode", + message="CompilationResultAction.SimpleLoadMode", + ) + append: "CompilationResultAction.SimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=2, + oneof="mode", + message="CompilationResultAction.SimpleLoadMode", + ) + maximum: "CompilationResultAction.IncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=3, + oneof="mode", + message="CompilationResultAction.IncrementalLoadMode", + ) + unique: "CompilationResultAction.IncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=4, + oneof="mode", + message="CompilationResultAction.IncrementalLoadMode", + ) + + class SimpleLoadMode(proto.Message): + r"""Simple load definition""" + + class IncrementalLoadMode(proto.Message): + r"""Load definition for incremental load modes + + Attributes: + column (str): + Column name for incremental load modes + """ + + column: str = proto.Field( + proto.STRING, + number=1, + ) + relation: Relation = proto.Field( proto.MESSAGE, number=4, @@ -3155,6 +3361,12 @@ class Notebook(proto.Message): oneof="compiled_object", message=Notebook, ) + data_preparation: DataPreparation = proto.Field( + proto.MESSAGE, + number=9, + oneof="compiled_object", + message=DataPreparation, + ) target: "Target" = proto.Field( proto.MESSAGE, number=1, @@ -3278,6 +3490,9 @@ class WorkflowConfig(proto.Message): execution attempts, ordered in descending order of ``execution_time``. Updated whenever automatic creation of a workflow invocation is triggered by cron_schedule. + disabled (bool): + Optional. Disables automatic creation of + workflow invocations. create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The timestamp of when the WorkflowConfig was created. @@ -3367,6 +3582,10 @@ class ScheduledExecutionRecord(proto.Message): number=5, message=ScheduledExecutionRecord, ) + disabled: bool = proto.Field( + proto.BOOL, + number=8, + ) create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, @@ -3893,6 +4112,11 @@ class WorkflowInvocationAction(proto.Message): Output only. The workflow action's notebook action details. + This field is a member of `oneof`_ ``action``. + data_preparation_action (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction): + Output only. The workflow action's data + preparation action details. + This field is a member of `oneof`_ ``action``. target (google.cloud.dataform_v1beta1.types.Target): Output only. This action's identifier. Unique @@ -3999,6 +4223,183 @@ class NotebookAction(proto.Message): number=2, ) + class DataPreparationAction(proto.Message): + r"""Represents a workflow action that will run a Data + Preparation. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + contents_yaml (str): + Output only. YAML representing the contents + of the data preparation. Can be used to show the + customer what the input was to their workflow. + + This field is a member of `oneof`_ ``definition``. + contents_sql (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition): + SQL definition for a Data Preparation. + Contains a SQL query and additional context + information. + + This field is a member of `oneof`_ ``definition``. + generated_sql (str): + Output only. The generated BigQuery SQL + script that will be executed. For reference + only. + job_id (str): + Output only. The ID of the BigQuery job that executed the + SQL in sql_script. Only set once the job has started to run. + """ + + class ActionSqlDefinition(proto.Message): + r"""Definition of a SQL Data Preparation + + Attributes: + query (str): + The SQL query representing the data + preparation steps. Formatted as a Pipe SQL query + statement. + error_table (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionErrorTable): + Error table configuration, + load_config (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig): + Load configuration. + """ + + query: str = proto.Field( + proto.STRING, + number=1, + ) + error_table: "WorkflowInvocationAction.DataPreparationAction.ActionErrorTable" = proto.Field( + proto.MESSAGE, + number=2, + message="WorkflowInvocationAction.DataPreparationAction.ActionErrorTable", + ) + load_config: "WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig" = proto.Field( + proto.MESSAGE, + number=3, + message="WorkflowInvocationAction.DataPreparationAction.ActionLoadConfig", + ) + + class ActionErrorTable(proto.Message): + r"""Error table information, used to write error data into a + BigQuery table. + + Attributes: + target (google.cloud.dataform_v1beta1.types.Target): + Error Table target. + retention_days (int): + Error table partition expiration in days. + Only positive values are allowed. + """ + + target: "Target" = proto.Field( + proto.MESSAGE, + number=1, + message="Target", + ) + retention_days: int = proto.Field( + proto.INT32, + number=2, + ) + + class ActionLoadConfig(proto.Message): + r"""Simplified load configuration for actions + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + replace (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode): + Replace destination table + + This field is a member of `oneof`_ ``mode``. + append (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode): + Append into destination table + + This field is a member of `oneof`_ ``mode``. + maximum (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode): + Insert records where the value exceeds the + previous maximum value for a column in the + destination table + + This field is a member of `oneof`_ ``mode``. + unique (google.cloud.dataform_v1beta1.types.WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode): + Insert records where the value of a column is + not already present in the destination table + + This field is a member of `oneof`_ ``mode``. + """ + + replace: "WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=1, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode", + ) + append: "WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode" = proto.Field( + proto.MESSAGE, + number=2, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionSimpleLoadMode", + ) + maximum: "WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=3, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode", + ) + unique: "WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode" = proto.Field( + proto.MESSAGE, + number=4, + oneof="mode", + message="WorkflowInvocationAction.DataPreparationAction.ActionIncrementalLoadMode", + ) + + class ActionSimpleLoadMode(proto.Message): + r"""Simple load definition""" + + class ActionIncrementalLoadMode(proto.Message): + r"""Load definition for incremental load modes + + Attributes: + column (str): + Column name for incremental load modes + """ + + column: str = proto.Field( + proto.STRING, + number=1, + ) + + contents_yaml: str = proto.Field( + proto.STRING, + number=2, + oneof="definition", + ) + contents_sql: "WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition" = proto.Field( + proto.MESSAGE, + number=6, + oneof="definition", + message="WorkflowInvocationAction.DataPreparationAction.ActionSqlDefinition", + ) + generated_sql: str = proto.Field( + proto.STRING, + number=3, + ) + job_id: str = proto.Field( + proto.STRING, + number=4, + ) + bigquery_action: BigQueryAction = proto.Field( proto.MESSAGE, number=6, @@ -4011,6 +4412,12 @@ class NotebookAction(proto.Message): oneof="action", message=NotebookAction, ) + data_preparation_action: DataPreparationAction = proto.Field( + proto.MESSAGE, + number=9, + oneof="action", + message=DataPreparationAction, + ) target: "Target" = proto.Field( proto.MESSAGE, number=1, diff --git a/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1/test_dataform.py b/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1/test_dataform.py index f4a1696d1118..d788b05748a2 100644 --- a/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1/test_dataform.py +++ b/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1/test_dataform.py @@ -15412,6 +15412,7 @@ def test_get_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.get_workflow_config(request) @@ -15428,6 +15429,7 @@ def test_get_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15566,6 +15568,7 @@ async def test_get_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -15583,6 +15586,7 @@ async def test_get_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15769,6 +15773,7 @@ def test_create_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.create_workflow_config(request) @@ -15785,6 +15790,7 @@ def test_create_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15926,6 +15932,7 @@ async def test_create_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -15943,6 +15950,7 @@ async def test_create_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -16149,6 +16157,7 @@ def test_update_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.update_workflow_config(request) @@ -16165,6 +16174,7 @@ def test_update_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -16300,6 +16310,7 @@ async def test_update_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -16317,6 +16328,7 @@ async def test_update_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -32006,6 +32018,7 @@ async def test_get_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -32039,6 +32052,7 @@ async def test_create_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -32072,6 +32086,7 @@ async def test_update_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -37042,8 +37057,10 @@ def test_create_release_config_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "cron_schedule": "cron_schedule_value", @@ -37292,8 +37309,10 @@ def test_update_release_config_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "cron_schedule": "cron_schedule_value", @@ -37916,8 +37935,10 @@ def test_create_compilation_result_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "resolved_git_commit_sha": "resolved_git_commit_sha_value", @@ -38421,6 +38442,7 @@ def test_get_workflow_config_rest_call_success(request_type): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38442,6 +38464,7 @@ def test_get_workflow_config_rest_call_success(request_type): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -38579,6 +38602,7 @@ def test_create_workflow_config_rest_call_success(request_type): "execution_time": {"seconds": 751, "nanos": 543}, } ], + "disabled": True, "create_time": {}, "update_time": {}, "internal_metadata": "internal_metadata_value", @@ -38660,6 +38684,7 @@ def get_message_fields(field): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38681,6 +38706,7 @@ def get_message_fields(field): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -38826,6 +38852,7 @@ def test_update_workflow_config_rest_call_success(request_type): "execution_time": {"seconds": 751, "nanos": 543}, } ], + "disabled": True, "create_time": {}, "update_time": {}, "internal_metadata": "internal_metadata_value", @@ -38907,6 +38934,7 @@ def get_message_fields(field): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38928,6 +38956,7 @@ def get_message_fields(field): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -42528,11 +42557,39 @@ def test_parse_crypto_key_version_path(): assert expected == actual -def test_release_config_path(): +def test_notebook_runtime_template_path(): project = "cuttlefish" location = "mussel" - repository = "winkle" - release_config = "nautilus" + notebook_runtime_template = "winkle" + expected = "projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}".format( + project=project, + location=location, + notebook_runtime_template=notebook_runtime_template, + ) + actual = DataformClient.notebook_runtime_template_path( + project, location, notebook_runtime_template + ) + assert expected == actual + + +def test_parse_notebook_runtime_template_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "notebook_runtime_template": "abalone", + } + path = DataformClient.notebook_runtime_template_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_notebook_runtime_template_path(path) + assert expected == actual + + +def test_release_config_path(): + project = "squid" + location = "clam" + repository = "whelk" + release_config = "octopus" expected = "projects/{project}/locations/{location}/repositories/{repository}/releaseConfigs/{release_config}".format( project=project, location=location, @@ -42547,10 +42604,10 @@ def test_release_config_path(): def test_parse_release_config_path(): expected = { - "project": "scallop", - "location": "abalone", - "repository": "squid", - "release_config": "clam", + "project": "oyster", + "location": "nudibranch", + "repository": "cuttlefish", + "release_config": "mussel", } path = DataformClient.release_config_path(**expected) @@ -42560,9 +42617,9 @@ def test_parse_release_config_path(): def test_repository_path(): - project = "whelk" - location = "octopus" - repository = "oyster" + project = "winkle" + location = "nautilus" + repository = "scallop" expected = ( "projects/{project}/locations/{location}/repositories/{repository}".format( project=project, @@ -42576,9 +42633,9 @@ def test_repository_path(): def test_parse_repository_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "repository": "mussel", + "project": "abalone", + "location": "squid", + "repository": "clam", } path = DataformClient.repository_path(**expected) @@ -42588,9 +42645,9 @@ def test_parse_repository_path(): def test_secret_version_path(): - project = "winkle" - secret = "nautilus" - version = "scallop" + project = "whelk" + secret = "octopus" + version = "oyster" expected = "projects/{project}/secrets/{secret}/versions/{version}".format( project=project, secret=secret, @@ -42602,9 +42659,9 @@ def test_secret_version_path(): def test_parse_secret_version_path(): expected = { - "project": "abalone", - "secret": "squid", - "version": "clam", + "project": "nudibranch", + "secret": "cuttlefish", + "version": "mussel", } path = DataformClient.secret_version_path(**expected) @@ -42614,10 +42671,10 @@ def test_parse_secret_version_path(): def test_workflow_config_path(): - project = "whelk" - location = "octopus" - repository = "oyster" - workflow_config = "nudibranch" + project = "winkle" + location = "nautilus" + repository = "scallop" + workflow_config = "abalone" expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowConfigs/{workflow_config}".format( project=project, location=location, @@ -42632,10 +42689,10 @@ def test_workflow_config_path(): def test_parse_workflow_config_path(): expected = { - "project": "cuttlefish", - "location": "mussel", - "repository": "winkle", - "workflow_config": "nautilus", + "project": "squid", + "location": "clam", + "repository": "whelk", + "workflow_config": "octopus", } path = DataformClient.workflow_config_path(**expected) @@ -42645,10 +42702,10 @@ def test_parse_workflow_config_path(): def test_workflow_invocation_path(): - project = "scallop" - location = "abalone" - repository = "squid" - workflow_invocation = "clam" + project = "oyster" + location = "nudibranch" + repository = "cuttlefish" + workflow_invocation = "mussel" expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format( project=project, location=location, @@ -42663,10 +42720,10 @@ def test_workflow_invocation_path(): def test_parse_workflow_invocation_path(): expected = { - "project": "whelk", - "location": "octopus", - "repository": "oyster", - "workflow_invocation": "nudibranch", + "project": "winkle", + "location": "nautilus", + "repository": "scallop", + "workflow_invocation": "abalone", } path = DataformClient.workflow_invocation_path(**expected) @@ -42676,10 +42733,10 @@ def test_parse_workflow_invocation_path(): def test_workspace_path(): - project = "cuttlefish" - location = "mussel" - repository = "winkle" - workspace = "nautilus" + project = "squid" + location = "clam" + repository = "whelk" + workspace = "octopus" expected = "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format( project=project, location=location, @@ -42692,10 +42749,10 @@ def test_workspace_path(): def test_parse_workspace_path(): expected = { - "project": "scallop", - "location": "abalone", - "repository": "squid", - "workspace": "clam", + "project": "oyster", + "location": "nudibranch", + "repository": "cuttlefish", + "workspace": "mussel", } path = DataformClient.workspace_path(**expected) @@ -42705,7 +42762,7 @@ def test_parse_workspace_path(): def test_common_billing_account_path(): - billing_account = "whelk" + billing_account = "winkle" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -42715,7 +42772,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "octopus", + "billing_account": "nautilus", } path = DataformClient.common_billing_account_path(**expected) @@ -42725,7 +42782,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "oyster" + folder = "scallop" expected = "folders/{folder}".format( folder=folder, ) @@ -42735,7 +42792,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nudibranch", + "folder": "abalone", } path = DataformClient.common_folder_path(**expected) @@ -42745,7 +42802,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "cuttlefish" + organization = "squid" expected = "organizations/{organization}".format( organization=organization, ) @@ -42755,7 +42812,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "mussel", + "organization": "clam", } path = DataformClient.common_organization_path(**expected) @@ -42765,7 +42822,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "winkle" + project = "whelk" expected = "projects/{project}".format( project=project, ) @@ -42775,7 +42832,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "nautilus", + "project": "octopus", } path = DataformClient.common_project_path(**expected) @@ -42785,8 +42842,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "scallop" - location = "abalone" + project = "oyster" + location = "nudibranch" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -42797,8 +42854,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "squid", - "location": "clam", + "project": "cuttlefish", + "location": "mussel", } path = DataformClient.common_location_path(**expected) diff --git a/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1beta1/test_dataform.py b/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1beta1/test_dataform.py index c494d802b5d5..2307278bf06b 100644 --- a/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1beta1/test_dataform.py +++ b/packages/google-cloud-dataform/tests/unit/gapic/dataform_v1beta1/test_dataform.py @@ -15412,6 +15412,7 @@ def test_get_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.get_workflow_config(request) @@ -15428,6 +15429,7 @@ def test_get_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15566,6 +15568,7 @@ async def test_get_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -15583,6 +15586,7 @@ async def test_get_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15769,6 +15773,7 @@ def test_create_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.create_workflow_config(request) @@ -15785,6 +15790,7 @@ def test_create_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -15926,6 +15932,7 @@ async def test_create_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -15943,6 +15950,7 @@ async def test_create_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -16149,6 +16157,7 @@ def test_update_workflow_config(request_type, transport: str = "grpc"): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) response = client.update_workflow_config(request) @@ -16165,6 +16174,7 @@ def test_update_workflow_config(request_type, transport: str = "grpc"): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -16300,6 +16310,7 @@ async def test_update_workflow_config_async( release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -16317,6 +16328,7 @@ async def test_update_workflow_config_async( assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -32006,6 +32018,7 @@ async def test_get_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -32039,6 +32052,7 @@ async def test_create_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -32072,6 +32086,7 @@ async def test_update_workflow_config_empty_call_grpc_asyncio(): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) ) @@ -37042,8 +37057,10 @@ def test_create_release_config_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "cron_schedule": "cron_schedule_value", @@ -37292,8 +37309,10 @@ def test_update_release_config_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "cron_schedule": "cron_schedule_value", @@ -37916,8 +37935,10 @@ def test_create_compilation_result_rest_call_success(request_type): "database_suffix": "database_suffix_value", "schema_suffix": "schema_suffix_value", "table_prefix": "table_prefix_value", + "builtin_assertion_name_prefix": "builtin_assertion_name_prefix_value", "default_notebook_runtime_options": { - "gcs_output_bucket": "gcs_output_bucket_value" + "gcs_output_bucket": "gcs_output_bucket_value", + "ai_platform_notebook_runtime_template": "ai_platform_notebook_runtime_template_value", }, }, "resolved_git_commit_sha": "resolved_git_commit_sha_value", @@ -38421,6 +38442,7 @@ def test_get_workflow_config_rest_call_success(request_type): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38442,6 +38464,7 @@ def test_get_workflow_config_rest_call_success(request_type): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -38579,6 +38602,7 @@ def test_create_workflow_config_rest_call_success(request_type): "execution_time": {"seconds": 751, "nanos": 543}, } ], + "disabled": True, "create_time": {}, "update_time": {}, "internal_metadata": "internal_metadata_value", @@ -38660,6 +38684,7 @@ def get_message_fields(field): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38681,6 +38706,7 @@ def get_message_fields(field): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -38826,6 +38852,7 @@ def test_update_workflow_config_rest_call_success(request_type): "execution_time": {"seconds": 751, "nanos": 543}, } ], + "disabled": True, "create_time": {}, "update_time": {}, "internal_metadata": "internal_metadata_value", @@ -38907,6 +38934,7 @@ def get_message_fields(field): release_config="release_config_value", cron_schedule="cron_schedule_value", time_zone="time_zone_value", + disabled=True, internal_metadata="internal_metadata_value", ) @@ -38928,6 +38956,7 @@ def get_message_fields(field): assert response.release_config == "release_config_value" assert response.cron_schedule == "cron_schedule_value" assert response.time_zone == "time_zone_value" + assert response.disabled is True assert response.internal_metadata == "internal_metadata_value" @@ -42528,11 +42557,39 @@ def test_parse_crypto_key_version_path(): assert expected == actual -def test_release_config_path(): +def test_notebook_runtime_template_path(): project = "cuttlefish" location = "mussel" - repository = "winkle" - release_config = "nautilus" + notebook_runtime_template = "winkle" + expected = "projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}".format( + project=project, + location=location, + notebook_runtime_template=notebook_runtime_template, + ) + actual = DataformClient.notebook_runtime_template_path( + project, location, notebook_runtime_template + ) + assert expected == actual + + +def test_parse_notebook_runtime_template_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "notebook_runtime_template": "abalone", + } + path = DataformClient.notebook_runtime_template_path(**expected) + + # Check that the path construction is reversible. + actual = DataformClient.parse_notebook_runtime_template_path(path) + assert expected == actual + + +def test_release_config_path(): + project = "squid" + location = "clam" + repository = "whelk" + release_config = "octopus" expected = "projects/{project}/locations/{location}/repositories/{repository}/releaseConfigs/{release_config}".format( project=project, location=location, @@ -42547,10 +42604,10 @@ def test_release_config_path(): def test_parse_release_config_path(): expected = { - "project": "scallop", - "location": "abalone", - "repository": "squid", - "release_config": "clam", + "project": "oyster", + "location": "nudibranch", + "repository": "cuttlefish", + "release_config": "mussel", } path = DataformClient.release_config_path(**expected) @@ -42560,9 +42617,9 @@ def test_parse_release_config_path(): def test_repository_path(): - project = "whelk" - location = "octopus" - repository = "oyster" + project = "winkle" + location = "nautilus" + repository = "scallop" expected = ( "projects/{project}/locations/{location}/repositories/{repository}".format( project=project, @@ -42576,9 +42633,9 @@ def test_repository_path(): def test_parse_repository_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "repository": "mussel", + "project": "abalone", + "location": "squid", + "repository": "clam", } path = DataformClient.repository_path(**expected) @@ -42588,9 +42645,9 @@ def test_parse_repository_path(): def test_secret_version_path(): - project = "winkle" - secret = "nautilus" - version = "scallop" + project = "whelk" + secret = "octopus" + version = "oyster" expected = "projects/{project}/secrets/{secret}/versions/{version}".format( project=project, secret=secret, @@ -42602,9 +42659,9 @@ def test_secret_version_path(): def test_parse_secret_version_path(): expected = { - "project": "abalone", - "secret": "squid", - "version": "clam", + "project": "nudibranch", + "secret": "cuttlefish", + "version": "mussel", } path = DataformClient.secret_version_path(**expected) @@ -42614,10 +42671,10 @@ def test_parse_secret_version_path(): def test_workflow_config_path(): - project = "whelk" - location = "octopus" - repository = "oyster" - workflow_config = "nudibranch" + project = "winkle" + location = "nautilus" + repository = "scallop" + workflow_config = "abalone" expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowConfigs/{workflow_config}".format( project=project, location=location, @@ -42632,10 +42689,10 @@ def test_workflow_config_path(): def test_parse_workflow_config_path(): expected = { - "project": "cuttlefish", - "location": "mussel", - "repository": "winkle", - "workflow_config": "nautilus", + "project": "squid", + "location": "clam", + "repository": "whelk", + "workflow_config": "octopus", } path = DataformClient.workflow_config_path(**expected) @@ -42645,10 +42702,10 @@ def test_parse_workflow_config_path(): def test_workflow_invocation_path(): - project = "scallop" - location = "abalone" - repository = "squid" - workflow_invocation = "clam" + project = "oyster" + location = "nudibranch" + repository = "cuttlefish" + workflow_invocation = "mussel" expected = "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}".format( project=project, location=location, @@ -42663,10 +42720,10 @@ def test_workflow_invocation_path(): def test_parse_workflow_invocation_path(): expected = { - "project": "whelk", - "location": "octopus", - "repository": "oyster", - "workflow_invocation": "nudibranch", + "project": "winkle", + "location": "nautilus", + "repository": "scallop", + "workflow_invocation": "abalone", } path = DataformClient.workflow_invocation_path(**expected) @@ -42676,10 +42733,10 @@ def test_parse_workflow_invocation_path(): def test_workspace_path(): - project = "cuttlefish" - location = "mussel" - repository = "winkle" - workspace = "nautilus" + project = "squid" + location = "clam" + repository = "whelk" + workspace = "octopus" expected = "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}".format( project=project, location=location, @@ -42692,10 +42749,10 @@ def test_workspace_path(): def test_parse_workspace_path(): expected = { - "project": "scallop", - "location": "abalone", - "repository": "squid", - "workspace": "clam", + "project": "oyster", + "location": "nudibranch", + "repository": "cuttlefish", + "workspace": "mussel", } path = DataformClient.workspace_path(**expected) @@ -42705,7 +42762,7 @@ def test_parse_workspace_path(): def test_common_billing_account_path(): - billing_account = "whelk" + billing_account = "winkle" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -42715,7 +42772,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "octopus", + "billing_account": "nautilus", } path = DataformClient.common_billing_account_path(**expected) @@ -42725,7 +42782,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "oyster" + folder = "scallop" expected = "folders/{folder}".format( folder=folder, ) @@ -42735,7 +42792,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nudibranch", + "folder": "abalone", } path = DataformClient.common_folder_path(**expected) @@ -42745,7 +42802,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "cuttlefish" + organization = "squid" expected = "organizations/{organization}".format( organization=organization, ) @@ -42755,7 +42812,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "mussel", + "organization": "clam", } path = DataformClient.common_organization_path(**expected) @@ -42765,7 +42822,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "winkle" + project = "whelk" expected = "projects/{project}".format( project=project, ) @@ -42775,7 +42832,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "nautilus", + "project": "octopus", } path = DataformClient.common_project_path(**expected) @@ -42785,8 +42842,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "scallop" - location = "abalone" + project = "oyster" + location = "nudibranch" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -42797,8 +42854,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "squid", - "location": "clam", + "project": "cuttlefish", + "location": "mussel", } path = DataformClient.common_location_path(**expected)