zenml-nightly 0.58.2.dev20240615__py3-none-any.whl → 0.58.2.dev20240623__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zenml/VERSION +1 -1
- zenml/_hub/client.py +8 -5
- zenml/actions/base_action.py +8 -10
- zenml/artifact_stores/base_artifact_store.py +20 -15
- zenml/artifact_stores/local_artifact_store.py +3 -2
- zenml/artifacts/artifact_config.py +34 -19
- zenml/artifacts/external_artifact.py +18 -8
- zenml/artifacts/external_artifact_config.py +14 -6
- zenml/artifacts/unmaterialized_artifact.py +2 -11
- zenml/cli/__init__.py +6 -0
- zenml/cli/artifact.py +20 -2
- zenml/cli/base.py +1 -1
- zenml/cli/served_model.py +0 -1
- zenml/cli/server.py +3 -3
- zenml/cli/utils.py +36 -40
- zenml/cli/web_login.py +2 -2
- zenml/client.py +198 -24
- zenml/client_lazy_loader.py +20 -14
- zenml/config/base_settings.py +5 -6
- zenml/config/build_configuration.py +1 -1
- zenml/config/compiler.py +3 -3
- zenml/config/docker_settings.py +27 -28
- zenml/config/global_config.py +33 -37
- zenml/config/pipeline_configurations.py +8 -11
- zenml/config/pipeline_run_configuration.py +6 -2
- zenml/config/pipeline_spec.py +3 -4
- zenml/config/resource_settings.py +8 -9
- zenml/config/schedule.py +16 -20
- zenml/config/secret_reference_mixin.py +6 -3
- zenml/config/secrets_store_config.py +16 -23
- zenml/config/server_config.py +50 -46
- zenml/config/settings_resolver.py +1 -1
- zenml/config/source.py +45 -35
- zenml/config/step_configurations.py +53 -31
- zenml/config/step_run_info.py +3 -0
- zenml/config/store_config.py +20 -19
- zenml/config/strict_base_model.py +2 -6
- zenml/constants.py +26 -2
- zenml/container_registries/base_container_registry.py +3 -2
- zenml/container_registries/default_container_registry.py +3 -3
- zenml/event_hub/base_event_hub.py +1 -1
- zenml/event_sources/base_event_source.py +11 -16
- zenml/exceptions.py +4 -0
- zenml/integrations/airflow/__init__.py +2 -6
- zenml/integrations/airflow/flavors/airflow_orchestrator_flavor.py +6 -7
- zenml/integrations/airflow/orchestrators/airflow_orchestrator.py +13 -249
- zenml/integrations/airflow/orchestrators/dag_generator.py +5 -3
- zenml/integrations/argilla/flavors/argilla_annotator_flavor.py +5 -4
- zenml/integrations/aws/__init__.py +1 -1
- zenml/integrations/aws/flavors/aws_container_registry_flavor.py +3 -2
- zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py +11 -5
- zenml/integrations/aws/flavors/sagemaker_step_operator_flavor.py +6 -2
- zenml/integrations/aws/service_connectors/aws_service_connector.py +5 -4
- zenml/integrations/aws/step_operators/sagemaker_step_operator.py +1 -1
- zenml/integrations/azure/flavors/azureml_step_operator_flavor.py +4 -4
- zenml/integrations/azure/service_connectors/azure_service_connector.py +4 -3
- zenml/integrations/azure/step_operators/azureml_step_operator.py +2 -1
- zenml/integrations/bentoml/steps/bentoml_deployer.py +1 -1
- zenml/integrations/bitbucket/plugins/event_sources/bitbucket_webhook_event_source.py +8 -12
- zenml/integrations/comet/flavors/comet_experiment_tracker_flavor.py +1 -1
- zenml/integrations/constants.py +0 -1
- zenml/integrations/deepchecks/__init__.py +1 -0
- zenml/integrations/evidently/__init__.py +5 -3
- zenml/integrations/evidently/column_mapping.py +11 -3
- zenml/integrations/evidently/data_validators/evidently_data_validator.py +21 -3
- zenml/integrations/evidently/metrics.py +5 -6
- zenml/integrations/evidently/tests.py +5 -6
- zenml/integrations/facets/models.py +2 -6
- zenml/integrations/feast/__init__.py +3 -1
- zenml/integrations/feast/feature_stores/feast_feature_store.py +0 -23
- zenml/integrations/gcp/__init__.py +1 -1
- zenml/integrations/gcp/flavors/vertex_orchestrator_flavor.py +1 -1
- zenml/integrations/gcp/flavors/vertex_step_operator_flavor.py +1 -1
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +234 -103
- zenml/integrations/gcp/service_connectors/gcp_service_connector.py +57 -42
- zenml/integrations/gcp/step_operators/vertex_step_operator.py +1 -0
- zenml/integrations/github/code_repositories/github_code_repository.py +1 -1
- zenml/integrations/github/plugins/event_sources/github_webhook_event_source.py +9 -13
- zenml/integrations/great_expectations/__init__.py +1 -1
- zenml/integrations/great_expectations/data_validators/ge_data_validator.py +44 -44
- zenml/integrations/great_expectations/flavors/great_expectations_data_validator_flavor.py +35 -2
- zenml/integrations/great_expectations/ge_store_backend.py +24 -11
- zenml/integrations/great_expectations/materializers/ge_materializer.py +3 -3
- zenml/integrations/great_expectations/utils.py +5 -5
- zenml/integrations/huggingface/__init__.py +3 -0
- zenml/integrations/huggingface/flavors/huggingface_model_deployer_flavor.py +1 -1
- zenml/integrations/huggingface/steps/__init__.py +3 -0
- zenml/integrations/huggingface/steps/accelerate_runner.py +149 -0
- zenml/integrations/huggingface/steps/huggingface_deployer.py +2 -2
- zenml/integrations/hyperai/flavors/hyperai_orchestrator_flavor.py +1 -1
- zenml/integrations/hyperai/service_connectors/hyperai_service_connector.py +4 -3
- zenml/integrations/kubeflow/__init__.py +1 -1
- zenml/integrations/kubeflow/flavors/kubeflow_orchestrator_flavor.py +48 -81
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +295 -245
- zenml/integrations/kubernetes/flavors/kubernetes_orchestrator_flavor.py +1 -1
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +11 -2
- zenml/integrations/kubernetes/pod_settings.py +17 -31
- zenml/integrations/kubernetes/service_connectors/kubernetes_service_connector.py +8 -7
- zenml/integrations/label_studio/__init__.py +1 -3
- zenml/integrations/label_studio/annotators/label_studio_annotator.py +3 -4
- zenml/integrations/label_studio/flavors/label_studio_annotator_flavor.py +2 -2
- zenml/integrations/langchain/__init__.py +5 -1
- zenml/integrations/langchain/materializers/document_materializer.py +44 -8
- zenml/integrations/mlflow/__init__.py +9 -3
- zenml/integrations/mlflow/experiment_trackers/mlflow_experiment_tracker.py +1 -1
- zenml/integrations/mlflow/flavors/mlflow_experiment_tracker_flavor.py +29 -37
- zenml/integrations/mlflow/model_registries/mlflow_model_registry.py +4 -4
- zenml/integrations/mlflow/steps/mlflow_deployer.py +1 -1
- zenml/integrations/neptune/flavors/neptune_experiment_tracker_flavor.py +1 -1
- zenml/integrations/neural_prophet/__init__.py +5 -1
- zenml/integrations/pigeon/flavors/pigeon_annotator_flavor.py +1 -1
- zenml/integrations/s3/flavors/s3_artifact_store_flavor.py +9 -8
- zenml/integrations/seldon/seldon_client.py +52 -67
- zenml/integrations/seldon/services/seldon_deployment.py +3 -3
- zenml/integrations/seldon/steps/seldon_deployer.py +4 -4
- zenml/integrations/skypilot/flavors/skypilot_orchestrator_base_vm_config.py +15 -5
- zenml/integrations/skypilot_aws/__init__.py +1 -1
- zenml/integrations/skypilot_aws/flavors/skypilot_orchestrator_aws_vm_flavor.py +1 -1
- zenml/integrations/skypilot_azure/__init__.py +1 -1
- zenml/integrations/skypilot_azure/flavors/skypilot_orchestrator_azure_vm_flavor.py +1 -1
- zenml/integrations/skypilot_gcp/__init__.py +2 -1
- zenml/integrations/skypilot_gcp/flavors/skypilot_orchestrator_gcp_vm_flavor.py +1 -1
- zenml/integrations/skypilot_lambda/flavors/skypilot_orchestrator_lambda_vm_flavor.py +2 -2
- zenml/integrations/spark/flavors/spark_step_operator_flavor.py +1 -1
- zenml/integrations/spark/step_operators/spark_step_operator.py +2 -0
- zenml/integrations/tekton/__init__.py +1 -1
- zenml/integrations/tekton/flavors/tekton_orchestrator_flavor.py +66 -23
- zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +547 -233
- zenml/integrations/tensorboard/__init__.py +1 -12
- zenml/integrations/tensorboard/services/tensorboard_service.py +3 -5
- zenml/integrations/tensorboard/visualizers/tensorboard_visualizer.py +6 -6
- zenml/integrations/tensorflow/__init__.py +2 -10
- zenml/integrations/tensorflow/materializers/keras_materializer.py +17 -9
- zenml/integrations/wandb/flavors/wandb_experiment_tracker_flavor.py +9 -14
- zenml/integrations/whylogs/flavors/whylogs_data_validator_flavor.py +1 -1
- zenml/lineage_graph/lineage_graph.py +1 -1
- zenml/logging/step_logging.py +15 -7
- zenml/materializers/built_in_materializer.py +3 -3
- zenml/materializers/pydantic_materializer.py +2 -2
- zenml/metadata/lazy_load.py +4 -4
- zenml/metadata/metadata_types.py +64 -4
- zenml/model/model.py +79 -54
- zenml/model_deployers/base_model_deployer.py +14 -12
- zenml/model_registries/base_model_registry.py +17 -15
- zenml/models/__init__.py +79 -206
- zenml/models/v2/base/base.py +54 -41
- zenml/models/v2/base/base_plugin_flavor.py +2 -6
- zenml/models/v2/base/filter.py +91 -76
- zenml/models/v2/base/page.py +2 -12
- zenml/models/v2/base/scoped.py +4 -7
- zenml/models/v2/core/api_key.py +22 -8
- zenml/models/v2/core/artifact.py +2 -2
- zenml/models/v2/core/artifact_version.py +74 -40
- zenml/models/v2/core/code_repository.py +37 -10
- zenml/models/v2/core/component.py +65 -16
- zenml/models/v2/core/device.py +14 -4
- zenml/models/v2/core/event_source.py +1 -2
- zenml/models/v2/core/flavor.py +74 -8
- zenml/models/v2/core/logs.py +68 -8
- zenml/models/v2/core/model.py +8 -4
- zenml/models/v2/core/model_version.py +25 -6
- zenml/models/v2/core/model_version_artifact.py +51 -21
- zenml/models/v2/core/model_version_pipeline_run.py +45 -13
- zenml/models/v2/core/pipeline.py +37 -72
- zenml/models/v2/core/pipeline_build.py +29 -17
- zenml/models/v2/core/pipeline_deployment.py +18 -6
- zenml/models/v2/core/pipeline_namespace.py +113 -0
- zenml/models/v2/core/pipeline_run.py +50 -22
- zenml/models/v2/core/run_metadata.py +59 -36
- zenml/models/v2/core/schedule.py +37 -24
- zenml/models/v2/core/secret.py +31 -12
- zenml/models/v2/core/service.py +64 -36
- zenml/models/v2/core/service_account.py +24 -11
- zenml/models/v2/core/service_connector.py +219 -44
- zenml/models/v2/core/stack.py +45 -17
- zenml/models/v2/core/step_run.py +28 -8
- zenml/models/v2/core/tag.py +8 -4
- zenml/models/v2/core/trigger.py +2 -2
- zenml/models/v2/core/trigger_execution.py +1 -0
- zenml/models/v2/core/user.py +18 -21
- zenml/models/v2/core/workspace.py +13 -3
- zenml/models/v2/misc/build_item.py +3 -3
- zenml/models/v2/misc/external_user.py +2 -6
- zenml/models/v2/misc/hub_plugin_models.py +9 -9
- zenml/models/v2/misc/loaded_visualization.py +2 -2
- zenml/models/v2/misc/service_connector_type.py +8 -17
- zenml/models/v2/misc/user_auth.py +7 -2
- zenml/new/pipelines/build_utils.py +3 -3
- zenml/new/pipelines/pipeline.py +17 -13
- zenml/new/pipelines/run_utils.py +103 -1
- zenml/orchestrators/base_orchestrator.py +10 -7
- zenml/orchestrators/local_docker/local_docker_orchestrator.py +1 -1
- zenml/orchestrators/step_launcher.py +28 -4
- zenml/orchestrators/step_runner.py +3 -6
- zenml/orchestrators/utils.py +1 -1
- zenml/plugins/base_plugin_flavor.py +6 -10
- zenml/plugins/plugin_flavor_registry.py +3 -7
- zenml/secret/base_secret.py +7 -8
- zenml/service_connectors/docker_service_connector.py +4 -3
- zenml/service_connectors/service_connector.py +5 -12
- zenml/service_connectors/service_connector_registry.py +2 -4
- zenml/services/container/container_service.py +1 -1
- zenml/services/container/container_service_endpoint.py +1 -1
- zenml/services/local/local_service.py +1 -1
- zenml/services/local/local_service_endpoint.py +1 -1
- zenml/services/service.py +16 -10
- zenml/services/service_type.py +4 -5
- zenml/services/terraform/terraform_service.py +1 -1
- zenml/stack/flavor.py +1 -5
- zenml/stack/flavor_registry.py +4 -4
- zenml/stack/stack.py +4 -1
- zenml/stack/stack_component.py +55 -31
- zenml/step_operators/step_operator_entrypoint_configuration.py +1 -0
- zenml/steps/base_step.py +34 -28
- zenml/steps/entrypoint_function_utils.py +3 -5
- zenml/steps/utils.py +12 -14
- zenml/utils/cuda_utils.py +50 -0
- zenml/utils/deprecation_utils.py +18 -20
- zenml/utils/dict_utils.py +1 -1
- zenml/utils/filesync_model.py +65 -28
- zenml/utils/function_utils.py +260 -0
- zenml/utils/json_utils.py +131 -0
- zenml/utils/mlstacks_utils.py +2 -2
- zenml/utils/pipeline_docker_image_builder.py +9 -0
- zenml/utils/pydantic_utils.py +270 -62
- zenml/utils/secret_utils.py +65 -12
- zenml/utils/source_utils.py +2 -2
- zenml/utils/typed_model.py +5 -3
- zenml/utils/typing_utils.py +243 -0
- zenml/utils/yaml_utils.py +1 -1
- zenml/zen_server/auth.py +2 -2
- zenml/zen_server/cloud_utils.py +6 -6
- zenml/zen_server/deploy/base_provider.py +1 -1
- zenml/zen_server/deploy/deployment.py +6 -8
- zenml/zen_server/deploy/docker/docker_zen_server.py +3 -4
- zenml/zen_server/deploy/local/local_provider.py +0 -1
- zenml/zen_server/deploy/local/local_zen_server.py +6 -6
- zenml/zen_server/deploy/terraform/terraform_zen_server.py +4 -6
- zenml/zen_server/exceptions.py +4 -1
- zenml/zen_server/feature_gate/zenml_cloud_feature_gate.py +1 -1
- zenml/zen_server/pipeline_deployment/utils.py +48 -68
- zenml/zen_server/rbac/models.py +2 -5
- zenml/zen_server/rbac/utils.py +11 -14
- zenml/zen_server/routers/auth_endpoints.py +2 -2
- zenml/zen_server/routers/pipeline_builds_endpoints.py +1 -1
- zenml/zen_server/routers/runs_endpoints.py +1 -1
- zenml/zen_server/routers/secrets_endpoints.py +3 -2
- zenml/zen_server/routers/server_endpoints.py +1 -1
- zenml/zen_server/routers/steps_endpoints.py +1 -1
- zenml/zen_server/routers/workspaces_endpoints.py +1 -1
- zenml/zen_stores/base_zen_store.py +46 -9
- zenml/zen_stores/migrations/utils.py +42 -46
- zenml/zen_stores/migrations/versions/0701da9951a0_added_service_table.py +1 -1
- zenml/zen_stores/migrations/versions/1041bc644e0d_remove_secrets_manager.py +5 -3
- zenml/zen_stores/migrations/versions/10a907dad202_delete_mlmd_tables.py +1 -1
- zenml/zen_stores/migrations/versions/26b776ad583e_redesign_artifacts.py +8 -10
- zenml/zen_stores/migrations/versions/37835ce041d2_optimizing_database.py +3 -3
- zenml/zen_stores/migrations/versions/46506f72f0ed_add_server_settings.py +10 -12
- zenml/zen_stores/migrations/versions/5994f9ad0489_introduce_role_permissions.py +3 -2
- zenml/zen_stores/migrations/versions/6917bce75069_add_pipeline_run_unique_constraint.py +4 -4
- zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py +3 -2
- zenml/zen_stores/migrations/versions/743ec82b1b3c_update_size_of_build_images.py +2 -2
- zenml/zen_stores/migrations/versions/7500f434b71c_remove_shared_columns.py +3 -2
- zenml/zen_stores/migrations/versions/7834208cc3f6_artifact_project_scoping.py +8 -7
- zenml/zen_stores/migrations/versions/7b651bf6822e_track_secrets_in_db.py +6 -4
- zenml/zen_stores/migrations/versions/7e4a481d17f7_add_identity_table.py +2 -2
- zenml/zen_stores/migrations/versions/7f603e583dd7_fixed_migration.py +1 -1
- zenml/zen_stores/migrations/versions/a39c4184c8ce_remove_secrets_manager_flavors.py +2 -2
- zenml/zen_stores/migrations/versions/a91762e6be36_artifact_version_table.py +4 -4
- zenml/zen_stores/migrations/versions/alembic_start.py +1 -1
- zenml/zen_stores/migrations/versions/fbd7f18ced1e_increase_step_run_field_lengths.py +4 -4
- zenml/zen_stores/rest_zen_store.py +109 -49
- zenml/zen_stores/schemas/api_key_schemas.py +1 -1
- zenml/zen_stores/schemas/artifact_schemas.py +8 -8
- zenml/zen_stores/schemas/artifact_visualization_schemas.py +3 -3
- zenml/zen_stores/schemas/code_repository_schemas.py +1 -1
- zenml/zen_stores/schemas/component_schemas.py +8 -3
- zenml/zen_stores/schemas/device_schemas.py +8 -6
- zenml/zen_stores/schemas/event_source_schemas.py +3 -4
- zenml/zen_stores/schemas/flavor_schemas.py +5 -3
- zenml/zen_stores/schemas/model_schemas.py +26 -1
- zenml/zen_stores/schemas/pipeline_build_schemas.py +1 -1
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +4 -4
- zenml/zen_stores/schemas/pipeline_run_schemas.py +6 -6
- zenml/zen_stores/schemas/pipeline_schemas.py +5 -2
- zenml/zen_stores/schemas/run_metadata_schemas.py +2 -2
- zenml/zen_stores/schemas/secret_schemas.py +8 -5
- zenml/zen_stores/schemas/server_settings_schemas.py +3 -1
- zenml/zen_stores/schemas/service_connector_schemas.py +1 -1
- zenml/zen_stores/schemas/service_schemas.py +11 -2
- zenml/zen_stores/schemas/stack_schemas.py +1 -1
- zenml/zen_stores/schemas/step_run_schemas.py +11 -11
- zenml/zen_stores/schemas/tag_schemas.py +6 -2
- zenml/zen_stores/schemas/trigger_schemas.py +2 -2
- zenml/zen_stores/schemas/user_schemas.py +2 -2
- zenml/zen_stores/schemas/workspace_schemas.py +3 -1
- zenml/zen_stores/secrets_stores/aws_secrets_store.py +19 -20
- zenml/zen_stores/secrets_stores/azure_secrets_store.py +17 -20
- zenml/zen_stores/secrets_stores/base_secrets_store.py +79 -12
- zenml/zen_stores/secrets_stores/gcp_secrets_store.py +17 -20
- zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py +4 -8
- zenml/zen_stores/secrets_stores/service_connector_secrets_store.py +10 -7
- zenml/zen_stores/secrets_stores/sql_secrets_store.py +5 -6
- zenml/zen_stores/sql_zen_store.py +196 -120
- zenml/zen_stores/zen_store_interface.py +33 -0
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/METADATA +9 -7
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/RECORD +310 -307
- zenml/integrations/kubeflow/utils.py +0 -95
- zenml/models/v2/base/internal.py +0 -37
- zenml/models/v2/base/update.py +0 -44
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.58.2.dev20240615.dist-info → zenml_nightly-0.58.2.dev20240623.dist-info}/entry_points.txt +0 -0
zenml/models/v2/core/logs.py
CHANGED
@@ -13,10 +13,10 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Models representing logs."""
|
15
15
|
|
16
|
-
from typing import Optional, Union
|
16
|
+
from typing import Any, Optional, Union
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
|
-
from pydantic import Field
|
19
|
+
from pydantic import Field, field_validator
|
20
20
|
|
21
21
|
from zenml.constants import STR_FIELD_MAX_LENGTH, TEXT_FIELD_MAX_LENGTH
|
22
22
|
from zenml.models.v2.base.base import (
|
@@ -33,15 +33,55 @@ from zenml.models.v2.base.base import (
|
|
33
33
|
class LogsRequest(BaseRequest):
|
34
34
|
"""Request model for logs."""
|
35
35
|
|
36
|
-
uri: str = Field(
|
37
|
-
|
38
|
-
max_length=TEXT_FIELD_MAX_LENGTH,
|
39
|
-
)
|
36
|
+
uri: str = Field(title="The uri of the logs file")
|
37
|
+
|
40
38
|
artifact_store_id: Union[str, UUID] = Field(
|
41
39
|
title="The artifact store ID to associate the logs with.",
|
42
|
-
|
40
|
+
union_mode="left_to_right",
|
43
41
|
)
|
44
42
|
|
43
|
+
@field_validator("uri")
|
44
|
+
@classmethod
|
45
|
+
def text_field_max_length_check(cls, value: Any) -> Any:
|
46
|
+
"""Checks if the length of the value exceeds the maximum text length.
|
47
|
+
|
48
|
+
Args:
|
49
|
+
value: the value set in the field
|
50
|
+
|
51
|
+
Returns:
|
52
|
+
the value itself.
|
53
|
+
|
54
|
+
Raises:
|
55
|
+
AssertionError: if the length of the field is longer than the
|
56
|
+
maximum threshold.
|
57
|
+
"""
|
58
|
+
assert len(str(value)) < TEXT_FIELD_MAX_LENGTH, (
|
59
|
+
"The length of the value for this field can not "
|
60
|
+
f"exceed {TEXT_FIELD_MAX_LENGTH}"
|
61
|
+
)
|
62
|
+
return value
|
63
|
+
|
64
|
+
@field_validator("artifact_store_id")
|
65
|
+
@classmethod
|
66
|
+
def str_field_max_length_check(cls, value: Any) -> Any:
|
67
|
+
"""Checks if the length of the value exceeds the maximum text length.
|
68
|
+
|
69
|
+
Args:
|
70
|
+
value: the value set in the field
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
the value itself.
|
74
|
+
|
75
|
+
Raises:
|
76
|
+
AssertionError: if the length of the field is longer than the
|
77
|
+
maximum threshold.
|
78
|
+
"""
|
79
|
+
assert len(str(value)) < STR_FIELD_MAX_LENGTH, (
|
80
|
+
"The length of the value for this field can not "
|
81
|
+
f"exceed {STR_FIELD_MAX_LENGTH}"
|
82
|
+
)
|
83
|
+
return value
|
84
|
+
|
45
85
|
|
46
86
|
# ------------------ Update Model ------------------
|
47
87
|
|
@@ -66,17 +106,37 @@ class LogsResponseMetadata(BaseResponseMetadata):
|
|
66
106
|
title="Step ID to associate the logs with.",
|
67
107
|
default=None,
|
68
108
|
description="When this is set, pipeline_run_id should be set to None.",
|
109
|
+
union_mode="left_to_right",
|
69
110
|
)
|
70
111
|
pipeline_run_id: Optional[Union[str, UUID]] = Field(
|
71
112
|
title="Pipeline run ID to associate the logs with.",
|
72
113
|
default=None,
|
73
114
|
description="When this is set, step_run_id should be set to None.",
|
115
|
+
union_mode="left_to_right",
|
74
116
|
)
|
75
117
|
artifact_store_id: Union[str, UUID] = Field(
|
76
118
|
title="The artifact store ID to associate the logs with.",
|
77
|
-
|
119
|
+
union_mode="left_to_right",
|
78
120
|
)
|
79
121
|
|
122
|
+
@field_validator("artifact_store_id")
|
123
|
+
@classmethod
|
124
|
+
def str_field_max_length_check(cls, value: Any) -> Any:
|
125
|
+
"""Checks if the length of the value exceeds the maximum text length.
|
126
|
+
|
127
|
+
Args:
|
128
|
+
value: the value set in the field
|
129
|
+
|
130
|
+
Returns:
|
131
|
+
the value itself.
|
132
|
+
|
133
|
+
Raises:
|
134
|
+
AssertionError: if the length of the field is longer than the
|
135
|
+
maximum threshold.
|
136
|
+
"""
|
137
|
+
assert len(str(value)) < STR_FIELD_MAX_LENGTH
|
138
|
+
return value
|
139
|
+
|
80
140
|
|
81
141
|
class LogsResponseResources(BaseResponseResources):
|
82
142
|
"""Class for all resource models associated with the Logs entity."""
|
zenml/models/v2/core/model.py
CHANGED
@@ -117,8 +117,8 @@ class ModelResponseBody(WorkspaceScopedResponseBody):
|
|
117
117
|
tags: List["TagResponse"] = Field(
|
118
118
|
title="Tags associated with the model",
|
119
119
|
)
|
120
|
-
latest_version_name: Optional[str]
|
121
|
-
latest_version_id: Optional[UUID]
|
120
|
+
latest_version_name: Optional[str] = None
|
121
|
+
latest_version_id: Optional[UUID] = None
|
122
122
|
|
123
123
|
|
124
124
|
class ModelResponseMetadata(WorkspaceScopedResponseMetadata):
|
@@ -322,10 +322,14 @@ class ModelFilter(WorkspaceScopedTaggableFilter):
|
|
322
322
|
description="Name of the Model",
|
323
323
|
)
|
324
324
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
325
|
-
default=None,
|
325
|
+
default=None,
|
326
|
+
description="Workspace of the Model",
|
327
|
+
union_mode="left_to_right",
|
326
328
|
)
|
327
329
|
user_id: Optional[Union[UUID, str]] = Field(
|
328
|
-
default=None,
|
330
|
+
default=None,
|
331
|
+
description="User of the Model",
|
332
|
+
union_mode="left_to_right",
|
329
333
|
)
|
330
334
|
|
331
335
|
CLI_EXCLUDE_FIELDS: ClassVar[List[str]] = [
|
@@ -16,7 +16,7 @@
|
|
16
16
|
from typing import TYPE_CHECKING, Dict, List, Optional, Type, TypeVar, Union
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
|
-
from pydantic import BaseModel, Field, PrivateAttr,
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, PrivateAttr, field_validator
|
20
20
|
|
21
21
|
from zenml.constants import STR_FIELD_MAX_LENGTH, TEXT_FIELD_MAX_LENGTH
|
22
22
|
from zenml.enums import ModelStages
|
@@ -70,12 +70,14 @@ class ModelVersionRequest(WorkspaceScopedRequest):
|
|
70
70
|
|
71
71
|
number: Optional[int] = Field(
|
72
72
|
description="The number of the model version",
|
73
|
+
default=None,
|
73
74
|
)
|
74
75
|
model: UUID = Field(
|
75
76
|
description="The ID of the model containing version",
|
76
77
|
)
|
77
78
|
tags: Optional[List[str]] = Field(
|
78
79
|
title="Tags associated with the model version",
|
80
|
+
default=None,
|
79
81
|
)
|
80
82
|
|
81
83
|
|
@@ -89,7 +91,9 @@ class ModelVersionUpdate(BaseModel):
|
|
89
91
|
description="The ID of the model containing version",
|
90
92
|
)
|
91
93
|
stage: Optional[Union[str, ModelStages]] = Field(
|
92
|
-
description="Target model version stage to be set",
|
94
|
+
description="Target model version stage to be set",
|
95
|
+
default=None,
|
96
|
+
union_mode="left_to_right",
|
93
97
|
)
|
94
98
|
force: bool = Field(
|
95
99
|
description="Whether existing model version in target stage should be "
|
@@ -113,7 +117,8 @@ class ModelVersionUpdate(BaseModel):
|
|
113
117
|
default=None,
|
114
118
|
)
|
115
119
|
|
116
|
-
@
|
120
|
+
@field_validator("stage")
|
121
|
+
@classmethod
|
117
122
|
def _validate_stage(cls, stage: str) -> str:
|
118
123
|
stage = getattr(stage, "value", stage)
|
119
124
|
if stage is not None and stage not in [
|
@@ -160,6 +165,14 @@ class ModelVersionResponseBody(WorkspaceScopedResponseBody):
|
|
160
165
|
title="Tags associated with the model version", default=[]
|
161
166
|
)
|
162
167
|
|
168
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
169
|
+
# fields defined under base models. If not handled, this raises a warning.
|
170
|
+
# It is possible to suppress this warning message with the following
|
171
|
+
# configuration, however the ultimate solution is to rename these fields.
|
172
|
+
# Even though they do not cause any problems right now, if we are not
|
173
|
+
# careful we might overwrite some fields protected by pydantic.
|
174
|
+
model_config = ConfigDict(protected_namespaces=())
|
175
|
+
|
163
176
|
|
164
177
|
class ModelVersionResponseMetadata(WorkspaceScopedResponseMetadata):
|
165
178
|
"""Response metadata for model versions."""
|
@@ -578,13 +591,19 @@ class ModelVersionFilter(WorkspaceScopedTaggableFilter):
|
|
578
591
|
description="The number of the Model Version",
|
579
592
|
)
|
580
593
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
581
|
-
default=None,
|
594
|
+
default=None,
|
595
|
+
description="The workspace of the Model Version",
|
596
|
+
union_mode="left_to_right",
|
582
597
|
)
|
583
598
|
user_id: Optional[Union[UUID, str]] = Field(
|
584
|
-
default=None,
|
599
|
+
default=None,
|
600
|
+
description="The user of the Model Version",
|
601
|
+
union_mode="left_to_right",
|
585
602
|
)
|
586
603
|
stage: Optional[Union[str, ModelStages]] = Field(
|
587
|
-
description="The model version stage",
|
604
|
+
description="The model version stage",
|
605
|
+
default=None,
|
606
|
+
union_mode="left_to_right",
|
588
607
|
)
|
589
608
|
|
590
609
|
_model_id: UUID = PrivateAttr(None)
|
@@ -13,11 +13,10 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Models representing the link between model versions and artifacts."""
|
15
15
|
|
16
|
-
from typing import TYPE_CHECKING,
|
16
|
+
from typing import TYPE_CHECKING, List, Optional, Union
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
|
-
from pydantic import Field,
|
20
|
-
from sqlalchemy.sql.elements import BinaryExpression, BooleanClauseList
|
19
|
+
from pydantic import ConfigDict, Field, model_validator
|
21
20
|
|
22
21
|
from zenml.enums import GenericFilterOps
|
23
22
|
from zenml.models.v2.base.base import (
|
@@ -33,6 +32,8 @@ from zenml.models.v2.base.scoped import (
|
|
33
32
|
)
|
34
33
|
|
35
34
|
if TYPE_CHECKING:
|
35
|
+
from sqlalchemy.sql.elements import ColumnElement
|
36
|
+
|
36
37
|
from zenml.models.v2.core.artifact_version import ArtifactVersionResponse
|
37
38
|
|
38
39
|
|
@@ -48,17 +49,22 @@ class ModelVersionArtifactRequest(WorkspaceScopedRequest):
|
|
48
49
|
is_model_artifact: bool = False
|
49
50
|
is_deployment_artifact: bool = False
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
53
|
+
# fields defined under base models. If not handled, this raises a warning.
|
54
|
+
# It is possible to suppress this warning message with the following
|
55
|
+
# configuration, however the ultimate solution is to rename these fields.
|
56
|
+
# Even though they do not cause any problems right now, if we are not
|
57
|
+
# careful we might overwrite some fields protected by pydantic.
|
58
|
+
model_config = ConfigDict(protected_namespaces=())
|
59
|
+
|
60
|
+
@model_validator(mode="after")
|
61
|
+
def _validate_is_endpoint_artifact(self) -> "ModelVersionArtifactRequest":
|
62
|
+
if self.is_model_artifact and self.is_deployment_artifact:
|
57
63
|
raise ValueError(
|
58
64
|
"Artifact cannot be a model artifact and deployment artifact "
|
59
65
|
"at the same time."
|
60
66
|
)
|
61
|
-
return
|
67
|
+
return self
|
62
68
|
|
63
69
|
|
64
70
|
# ------------------ Update Model ------------------
|
@@ -77,6 +83,14 @@ class ModelVersionArtifactResponseBody(BaseDatedResponseBody):
|
|
77
83
|
is_model_artifact: bool = False
|
78
84
|
is_deployment_artifact: bool = False
|
79
85
|
|
86
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
87
|
+
# fields defined under base models. If not handled, this raises a warning.
|
88
|
+
# It is possible to suppress this warning message with the following
|
89
|
+
# configuration, however the ultimate solution is to rename these fields.
|
90
|
+
# Even though they do not cause any problems right now, if we are not
|
91
|
+
# careful we might overwrite some fields protected by pydantic.
|
92
|
+
model_config = ConfigDict(protected_namespaces=())
|
93
|
+
|
80
94
|
|
81
95
|
class ModelVersionArtifactResponseResources(BaseResponseResources):
|
82
96
|
"""Class for all resource models associated with the model version artifact entity."""
|
@@ -168,19 +182,29 @@ class ModelVersionArtifactFilter(WorkspaceScopedFilter):
|
|
168
182
|
]
|
169
183
|
|
170
184
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
171
|
-
default=None,
|
185
|
+
default=None,
|
186
|
+
description="The workspace of the Model Version",
|
187
|
+
union_mode="left_to_right",
|
172
188
|
)
|
173
189
|
user_id: Optional[Union[UUID, str]] = Field(
|
174
|
-
default=None,
|
190
|
+
default=None,
|
191
|
+
description="The user of the Model Version",
|
192
|
+
union_mode="left_to_right",
|
175
193
|
)
|
176
194
|
model_id: Optional[Union[UUID, str]] = Field(
|
177
|
-
default=None,
|
195
|
+
default=None,
|
196
|
+
description="Filter by model ID",
|
197
|
+
union_mode="left_to_right",
|
178
198
|
)
|
179
199
|
model_version_id: Optional[Union[UUID, str]] = Field(
|
180
|
-
default=None,
|
200
|
+
default=None,
|
201
|
+
description="Filter by model version ID",
|
202
|
+
union_mode="left_to_right",
|
181
203
|
)
|
182
204
|
artifact_version_id: Optional[Union[UUID, str]] = Field(
|
183
|
-
default=None,
|
205
|
+
default=None,
|
206
|
+
description="Filter by artifact ID",
|
207
|
+
union_mode="left_to_right",
|
184
208
|
)
|
185
209
|
artifact_name: Optional[str] = Field(
|
186
210
|
default=None,
|
@@ -191,9 +215,15 @@ class ModelVersionArtifactFilter(WorkspaceScopedFilter):
|
|
191
215
|
only_deployment_artifacts: Optional[bool] = False
|
192
216
|
has_custom_name: Optional[bool] = None
|
193
217
|
|
194
|
-
|
195
|
-
|
196
|
-
|
218
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
219
|
+
# fields defined under base models. If not handled, this raises a warning.
|
220
|
+
# It is possible to suppress this warning message with the following
|
221
|
+
# configuration, however the ultimate solution is to rename these fields.
|
222
|
+
# Even though they do not cause any problems right now, if we are not
|
223
|
+
# careful we might overwrite some fields protected by pydantic.
|
224
|
+
model_config = ConfigDict(protected_namespaces=())
|
225
|
+
|
226
|
+
def get_custom_filters(self) -> List[Union["ColumnElement[bool]"]]:
|
197
227
|
"""Get custom filters.
|
198
228
|
|
199
229
|
Returns:
|
@@ -201,7 +231,7 @@ class ModelVersionArtifactFilter(WorkspaceScopedFilter):
|
|
201
231
|
"""
|
202
232
|
custom_filters = super().get_custom_filters()
|
203
233
|
|
204
|
-
from
|
234
|
+
from sqlmodel import and_
|
205
235
|
|
206
236
|
from zenml.zen_stores.schemas.artifact_schemas import (
|
207
237
|
ArtifactSchema,
|
@@ -218,7 +248,7 @@ class ModelVersionArtifactFilter(WorkspaceScopedFilter):
|
|
218
248
|
column="name",
|
219
249
|
value=value,
|
220
250
|
)
|
221
|
-
artifact_name_filter = and_(
|
251
|
+
artifact_name_filter = and_(
|
222
252
|
ModelVersionArtifactSchema.artifact_version_id
|
223
253
|
== ArtifactVersionSchema.id,
|
224
254
|
ArtifactVersionSchema.artifact_id == ArtifactSchema.id,
|
@@ -246,7 +276,7 @@ class ModelVersionArtifactFilter(WorkspaceScopedFilter):
|
|
246
276
|
custom_filters.append(deployment_artifact_filter)
|
247
277
|
|
248
278
|
if self.has_custom_name is not None:
|
249
|
-
custom_name_filter = and_(
|
279
|
+
custom_name_filter = and_(
|
250
280
|
ModelVersionArtifactSchema.artifact_version_id
|
251
281
|
== ArtifactVersionSchema.id,
|
252
282
|
ArtifactVersionSchema.artifact_id == ArtifactSchema.id,
|
@@ -13,11 +13,11 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""Models representing the link between model versions and pipeline runs."""
|
15
15
|
|
16
|
-
from typing import
|
16
|
+
from typing import List, Optional, Union
|
17
17
|
from uuid import UUID
|
18
18
|
|
19
|
-
from pydantic import Field
|
20
|
-
from sqlalchemy.sql.elements import
|
19
|
+
from pydantic import ConfigDict, Field
|
20
|
+
from sqlalchemy.sql.elements import ColumnElement
|
21
21
|
|
22
22
|
from zenml.enums import GenericFilterOps
|
23
23
|
from zenml.models.v2.base.base import (
|
@@ -43,6 +43,14 @@ class ModelVersionPipelineRunRequest(WorkspaceScopedRequest):
|
|
43
43
|
model_version: UUID
|
44
44
|
pipeline_run: UUID
|
45
45
|
|
46
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
47
|
+
# fields defined under base models. If not handled, this raises a warning.
|
48
|
+
# It is possible to suppress this warning message with the following
|
49
|
+
# configuration, however the ultimate solution is to rename these fields.
|
50
|
+
# Even though they do not cause any problems right now, if we are not
|
51
|
+
# careful we might overwrite some fields protected by pydantic.
|
52
|
+
model_config = ConfigDict(protected_namespaces=())
|
53
|
+
|
46
54
|
|
47
55
|
# ------------------ Update Model ------------------
|
48
56
|
|
@@ -58,6 +66,14 @@ class ModelVersionPipelineRunResponseBody(BaseDatedResponseBody):
|
|
58
66
|
model_version: UUID
|
59
67
|
pipeline_run: PipelineRunResponse
|
60
68
|
|
69
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
70
|
+
# fields defined under base models. If not handled, this raises a warning.
|
71
|
+
# It is possible to suppress this warning message with the following
|
72
|
+
# configuration, however the ultimate solution is to rename these fields.
|
73
|
+
# Even though they do not cause any problems right now, if we are not
|
74
|
+
# careful we might overwrite some fields protected by pydantic.
|
75
|
+
model_config = ConfigDict(protected_namespaces=())
|
76
|
+
|
61
77
|
|
62
78
|
class ModelVersionPipelineRunResponseResources(BaseResponseResources):
|
63
79
|
"""Class for all resource models associated with the model version pipeline run entity."""
|
@@ -123,28 +139,44 @@ class ModelVersionPipelineRunFilter(WorkspaceScopedFilter):
|
|
123
139
|
]
|
124
140
|
|
125
141
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
126
|
-
default=None,
|
142
|
+
default=None,
|
143
|
+
description="The workspace of the Model Version",
|
144
|
+
union_mode="left_to_right",
|
127
145
|
)
|
128
146
|
user_id: Optional[Union[UUID, str]] = Field(
|
129
|
-
default=None,
|
147
|
+
default=None,
|
148
|
+
description="The user of the Model Version",
|
149
|
+
union_mode="left_to_right",
|
130
150
|
)
|
131
151
|
model_id: Optional[Union[UUID, str]] = Field(
|
132
|
-
default=None,
|
152
|
+
default=None,
|
153
|
+
description="Filter by model ID",
|
154
|
+
union_mode="left_to_right",
|
133
155
|
)
|
134
156
|
model_version_id: Optional[Union[UUID, str]] = Field(
|
135
|
-
default=None,
|
157
|
+
default=None,
|
158
|
+
description="Filter by model version ID",
|
159
|
+
union_mode="left_to_right",
|
136
160
|
)
|
137
161
|
pipeline_run_id: Optional[Union[UUID, str]] = Field(
|
138
|
-
default=None,
|
162
|
+
default=None,
|
163
|
+
description="Filter by pipeline run ID",
|
164
|
+
union_mode="left_to_right",
|
139
165
|
)
|
140
166
|
pipeline_run_name: Optional[str] = Field(
|
141
167
|
default=None,
|
142
168
|
description="Name of the pipeline run",
|
143
169
|
)
|
144
170
|
|
145
|
-
|
146
|
-
|
147
|
-
|
171
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
172
|
+
# fields defined under base models. If not handled, this raises a warning.
|
173
|
+
# It is possible to suppress this warning message with the following
|
174
|
+
# configuration, however the ultimate solution is to rename these fields.
|
175
|
+
# Even though they do not cause any problems right now, if we are not
|
176
|
+
# careful we might overwrite some fields protected by pydantic.
|
177
|
+
model_config = ConfigDict(protected_namespaces=())
|
178
|
+
|
179
|
+
def get_custom_filters(self) -> List["ColumnElement[bool]"]:
|
148
180
|
"""Get custom filters.
|
149
181
|
|
150
182
|
Returns:
|
@@ -152,7 +184,7 @@ class ModelVersionPipelineRunFilter(WorkspaceScopedFilter):
|
|
152
184
|
"""
|
153
185
|
custom_filters = super().get_custom_filters()
|
154
186
|
|
155
|
-
from
|
187
|
+
from sqlmodel import and_
|
156
188
|
|
157
189
|
from zenml.zen_stores.schemas.model_schemas import (
|
158
190
|
ModelVersionPipelineRunSchema,
|
@@ -170,7 +202,7 @@ class ModelVersionPipelineRunFilter(WorkspaceScopedFilter):
|
|
170
202
|
column="name",
|
171
203
|
value=value,
|
172
204
|
)
|
173
|
-
pipeline_run_name_filter = and_(
|
205
|
+
pipeline_run_name_filter = and_(
|
174
206
|
ModelVersionPipelineRunSchema.pipeline_run_id
|
175
207
|
== PipelineRunSchema.id,
|
176
208
|
filter_.generate_query_conditions(PipelineRunSchema),
|
zenml/models/v2/core/pipeline.py
CHANGED
@@ -21,27 +21,18 @@ from pydantic import Field
|
|
21
21
|
from zenml.config.pipeline_spec import PipelineSpec
|
22
22
|
from zenml.constants import STR_FIELD_MAX_LENGTH, TEXT_FIELD_MAX_LENGTH
|
23
23
|
from zenml.enums import ExecutionStatus
|
24
|
-
from zenml.models import
|
25
|
-
|
26
|
-
BaseResponseMetadata,
|
24
|
+
from zenml.models.v2.base.base import BaseUpdate
|
25
|
+
from zenml.models.v2.base.scoped import (
|
27
26
|
WorkspaceScopedFilter,
|
28
27
|
WorkspaceScopedRequest,
|
29
28
|
WorkspaceScopedResponse,
|
30
29
|
WorkspaceScopedResponseBody,
|
31
30
|
WorkspaceScopedResponseMetadata,
|
31
|
+
WorkspaceScopedResponseResources,
|
32
32
|
)
|
33
|
-
from zenml.models.v2.base.base import (
|
34
|
-
BaseResponse,
|
35
|
-
BaseResponseBody,
|
36
|
-
BaseResponseResources,
|
37
|
-
)
|
38
|
-
from zenml.models.v2.base.scoped import WorkspaceScopedResponseResources
|
39
|
-
from zenml.models.v2.base.update import update_model
|
40
33
|
|
41
34
|
if TYPE_CHECKING:
|
42
|
-
from zenml.models.v2.core.pipeline_run import
|
43
|
-
PipelineRunResponse,
|
44
|
-
)
|
35
|
+
from zenml.models.v2.core.pipeline_run import PipelineRunResponse
|
45
36
|
|
46
37
|
|
47
38
|
# ------------------ Request Model ------------------
|
@@ -65,6 +56,7 @@ class PipelineRequest(WorkspaceScopedRequest):
|
|
65
56
|
docstring: Optional[str] = Field(
|
66
57
|
title="The docstring of the pipeline.",
|
67
58
|
max_length=TEXT_FIELD_MAX_LENGTH,
|
59
|
+
default=None,
|
68
60
|
)
|
69
61
|
spec: PipelineSpec = Field(title="The spec of the pipeline.")
|
70
62
|
|
@@ -72,10 +64,34 @@ class PipelineRequest(WorkspaceScopedRequest):
|
|
72
64
|
# ------------------ Update Model ------------------
|
73
65
|
|
74
66
|
|
75
|
-
|
76
|
-
class PipelineUpdate(PipelineRequest):
|
67
|
+
class PipelineUpdate(BaseUpdate):
|
77
68
|
"""Update model for pipelines."""
|
78
69
|
|
70
|
+
name: Optional[str] = Field(
|
71
|
+
title="The name of the pipeline.",
|
72
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
73
|
+
default=None,
|
74
|
+
)
|
75
|
+
version: Optional[str] = Field(
|
76
|
+
title="The version of the pipeline.",
|
77
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
78
|
+
default=None,
|
79
|
+
)
|
80
|
+
version_hash: Optional[str] = Field(
|
81
|
+
title="The version hash of the pipeline.",
|
82
|
+
max_length=STR_FIELD_MAX_LENGTH,
|
83
|
+
default=None,
|
84
|
+
)
|
85
|
+
docstring: Optional[str] = Field(
|
86
|
+
title="The docstring of the pipeline.",
|
87
|
+
max_length=TEXT_FIELD_MAX_LENGTH,
|
88
|
+
default=None,
|
89
|
+
)
|
90
|
+
spec: Optional[PipelineSpec] = Field(
|
91
|
+
title="The spec of the pipeline.",
|
92
|
+
default=None,
|
93
|
+
)
|
94
|
+
|
79
95
|
|
80
96
|
# ------------------ Response Model ------------------
|
81
97
|
|
@@ -103,6 +119,7 @@ class PipelineResponseMetadata(WorkspaceScopedResponseMetadata):
|
|
103
119
|
docstring: Optional[str] = Field(
|
104
120
|
title="The docstring of the pipeline.",
|
105
121
|
max_length=TEXT_FIELD_MAX_LENGTH,
|
122
|
+
default=None,
|
106
123
|
)
|
107
124
|
|
108
125
|
|
@@ -277,64 +294,12 @@ class PipelineFilter(WorkspaceScopedFilter):
|
|
277
294
|
description="Docstring of the Pipeline",
|
278
295
|
)
|
279
296
|
workspace_id: Optional[Union[UUID, str]] = Field(
|
280
|
-
default=None, description="Workspace of the Pipeline"
|
281
|
-
)
|
282
|
-
user_id: Optional[Union[UUID, str]] = Field(
|
283
|
-
default=None, description="User of the Pipeline"
|
284
|
-
)
|
285
|
-
|
286
|
-
|
287
|
-
# ------------------ Pipeline Namespaces ------------------
|
288
|
-
|
289
|
-
|
290
|
-
class PipelineNamespaceResponseBody(BaseResponseBody):
|
291
|
-
"""Response body for pipeline namespaces."""
|
292
|
-
|
293
|
-
latest_run_id: Optional[UUID] = Field(
|
294
|
-
default=None,
|
295
|
-
title="The ID of the latest run of the pipeline namespace.",
|
296
|
-
)
|
297
|
-
latest_run_status: Optional[ExecutionStatus] = Field(
|
298
297
|
default=None,
|
299
|
-
|
298
|
+
description="Workspace of the Pipeline",
|
299
|
+
union_mode="left_to_right",
|
300
300
|
)
|
301
|
-
|
302
|
-
|
303
|
-
class PipelineNamespaceResponseMetadata(BaseResponseMetadata):
|
304
|
-
"""Response metadata for pipeline namespaces."""
|
305
|
-
|
306
|
-
|
307
|
-
class PipelineNamespaceResponseResources(BaseResponseResources):
|
308
|
-
"""Class for all resource models associated with the pipeline namespace entity."""
|
309
|
-
|
310
|
-
|
311
|
-
class PipelineNamespaceResponse(
|
312
|
-
BaseResponse[
|
313
|
-
PipelineNamespaceResponseBody,
|
314
|
-
PipelineNamespaceResponseMetadata,
|
315
|
-
PipelineNamespaceResponseResources,
|
316
|
-
]
|
317
|
-
):
|
318
|
-
"""Response model for pipeline namespaces."""
|
319
|
-
|
320
|
-
name: str = Field(
|
321
|
-
title="The name of the pipeline namespace.",
|
322
|
-
max_length=STR_FIELD_MAX_LENGTH,
|
323
|
-
)
|
324
|
-
|
325
|
-
def get_hydrated_version(self) -> "PipelineNamespaceResponse":
|
326
|
-
"""Get the hydrated version of this pipeline namespace.
|
327
|
-
|
328
|
-
Returns:
|
329
|
-
an instance of the same entity with the metadata field attached.
|
330
|
-
"""
|
331
|
-
return self
|
332
|
-
|
333
|
-
|
334
|
-
class PipelineNamespaceFilter(BaseFilter):
|
335
|
-
"""Pipeline namespace filter model."""
|
336
|
-
|
337
|
-
name: Optional[str] = Field(
|
301
|
+
user_id: Optional[Union[UUID, str]] = Field(
|
338
302
|
default=None,
|
339
|
-
description="
|
303
|
+
description="User of the Pipeline",
|
304
|
+
union_mode="left_to_right",
|
340
305
|
)
|