zenml-nightly 0.58.2.dev20240614__py3-none-any.whl → 0.58.2.dev20240622__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 +2 -2
- 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 +2 -6
- 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/package_utils.py +1 -1
- 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.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/METADATA +9 -7
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/RECORD +311 -308
- 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.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.58.2.dev20240614.dist-info → zenml_nightly-0.58.2.dev20240622.dist-info}/entry_points.txt +0 -0
@@ -90,7 +90,7 @@ class CodeRepositorySchema(NamedSchema, table=True):
|
|
90
90
|
workspace_id=request.workspace,
|
91
91
|
user_id=request.user,
|
92
92
|
config=json.dumps(request.config),
|
93
|
-
source=request.source.
|
93
|
+
source=request.source.model_dump_json(),
|
94
94
|
description=request.description,
|
95
95
|
logo_url=request.logo_url,
|
96
96
|
)
|
@@ -49,7 +49,7 @@ class StackComponentSchema(NamedSchema, table=True):
|
|
49
49
|
|
50
50
|
__tablename__ = "stack_component"
|
51
51
|
|
52
|
-
type:
|
52
|
+
type: str
|
53
53
|
flavor: str
|
54
54
|
configuration: bytes
|
55
55
|
labels: Optional[bytes]
|
@@ -116,7 +116,7 @@ class StackComponentSchema(NamedSchema, table=True):
|
|
116
116
|
Returns:
|
117
117
|
The updated `StackComponentSchema`.
|
118
118
|
"""
|
119
|
-
for field, value in component_update.
|
119
|
+
for field, value in component_update.model_dump(
|
120
120
|
exclude_unset=True, exclude={"workspace", "user", "connector"}
|
121
121
|
).items():
|
122
122
|
if field == "configuration":
|
@@ -127,6 +127,11 @@ class StackComponentSchema(NamedSchema, table=True):
|
|
127
127
|
self.labels = base64.b64encode(
|
128
128
|
json.dumps(component_update.labels).encode("utf-8")
|
129
129
|
)
|
130
|
+
elif field == "type":
|
131
|
+
component_type = component_update.type
|
132
|
+
|
133
|
+
if component_type is not None:
|
134
|
+
self.type = component_type
|
130
135
|
else:
|
131
136
|
setattr(self, field, value)
|
132
137
|
|
@@ -151,7 +156,7 @@ class StackComponentSchema(NamedSchema, table=True):
|
|
151
156
|
A `ComponentModel`
|
152
157
|
"""
|
153
158
|
body = ComponentResponseBody(
|
154
|
-
type=self.type,
|
159
|
+
type=StackComponentType(self.type),
|
155
160
|
flavor=self.flavor,
|
156
161
|
user=self.user.to_model() if self.user else None,
|
157
162
|
created=self.created,
|
@@ -44,7 +44,7 @@ class OAuthDeviceSchema(BaseSchema, table=True):
|
|
44
44
|
client_id: UUID
|
45
45
|
user_code: str
|
46
46
|
device_code: str
|
47
|
-
status:
|
47
|
+
status: str
|
48
48
|
failed_auth_attempts: int = 0
|
49
49
|
expires: Optional[datetime] = None
|
50
50
|
last_login: Optional[datetime] = None
|
@@ -121,7 +121,7 @@ class OAuthDeviceSchema(BaseSchema, table=True):
|
|
121
121
|
client_id=request.client_id,
|
122
122
|
user_code=hashed_user_code,
|
123
123
|
device_code=hashed_device_code,
|
124
|
-
status=OAuthDeviceStatus.PENDING,
|
124
|
+
status=OAuthDeviceStatus.PENDING.value,
|
125
125
|
failed_auth_attempts=0,
|
126
126
|
expires=now + timedelta(seconds=request.expires_in),
|
127
127
|
os=request.os,
|
@@ -148,14 +148,16 @@ class OAuthDeviceSchema(BaseSchema, table=True):
|
|
148
148
|
Returns:
|
149
149
|
The updated `OAuthDeviceSchema`.
|
150
150
|
"""
|
151
|
-
for field, value in device_update.
|
151
|
+
for field, value in device_update.model_dump(
|
152
|
+
exclude_none=True
|
153
|
+
).items():
|
152
154
|
if hasattr(self, field):
|
153
155
|
setattr(self, field, value)
|
154
156
|
|
155
157
|
if device_update.locked is True:
|
156
|
-
self.status = OAuthDeviceStatus.LOCKED
|
158
|
+
self.status = OAuthDeviceStatus.LOCKED.value
|
157
159
|
elif device_update.locked is False:
|
158
|
-
self.status = OAuthDeviceStatus.ACTIVE
|
160
|
+
self.status = OAuthDeviceStatus.ACTIVE.value
|
159
161
|
|
160
162
|
self.updated = datetime.utcnow()
|
161
163
|
return self
|
@@ -233,7 +235,7 @@ class OAuthDeviceSchema(BaseSchema, table=True):
|
|
233
235
|
client_id=self.client_id,
|
234
236
|
expires=self.expires,
|
235
237
|
trusted_device=self.trusted_device,
|
236
|
-
status=self.status,
|
238
|
+
status=OAuthDeviceStatus(self.status),
|
237
239
|
os=self.os,
|
238
240
|
ip_address=self.ip_address,
|
239
241
|
hostname=self.hostname,
|
@@ -19,10 +19,8 @@ from datetime import datetime
|
|
19
19
|
from typing import TYPE_CHECKING, Any, List, Optional, cast
|
20
20
|
from uuid import UUID
|
21
21
|
|
22
|
-
from pydantic import Field
|
23
|
-
from pydantic.json import pydantic_encoder
|
24
22
|
from sqlalchemy import TEXT, Column
|
25
|
-
from sqlmodel import Relationship
|
23
|
+
from sqlmodel import Field, Relationship
|
26
24
|
|
27
25
|
from zenml import EventSourceResponseMetadata
|
28
26
|
from zenml.models import (
|
@@ -33,6 +31,7 @@ from zenml.models import (
|
|
33
31
|
EventSourceUpdate,
|
34
32
|
Page,
|
35
33
|
)
|
34
|
+
from zenml.utils.json_utils import pydantic_encoder
|
36
35
|
from zenml.zen_stores.schemas.base_schemas import NamedSchema
|
37
36
|
from zenml.zen_stores.schemas.schema_utils import build_foreign_key_field
|
38
37
|
from zenml.zen_stores.schemas.user_schemas import UserSchema
|
@@ -174,7 +173,7 @@ class EventSourceSchema(NamedSchema, table=True):
|
|
174
173
|
Returns:
|
175
174
|
The updated `EventSourceSchema`.
|
176
175
|
"""
|
177
|
-
for field, value in update.
|
176
|
+
for field, value in update.model_dump(
|
178
177
|
exclude_unset=True, exclude_none=True
|
179
178
|
).items():
|
180
179
|
if field == "configuration":
|
@@ -46,7 +46,7 @@ class FlavorSchema(NamedSchema, table=True):
|
|
46
46
|
|
47
47
|
__tablename__ = "flavor"
|
48
48
|
|
49
|
-
type:
|
49
|
+
type: str
|
50
50
|
source: str
|
51
51
|
config_schema: str = Field(sa_column=Column(TEXT, nullable=False))
|
52
52
|
integration: Optional[str] = Field(default="")
|
@@ -93,11 +93,13 @@ class FlavorSchema(NamedSchema, table=True):
|
|
93
93
|
Returns:
|
94
94
|
The updated `FlavorSchema`.
|
95
95
|
"""
|
96
|
-
for field, value in flavor_update.
|
96
|
+
for field, value in flavor_update.model_dump(
|
97
97
|
exclude_unset=True, exclude={"workspace", "user"}
|
98
98
|
).items():
|
99
99
|
if field == "config_schema":
|
100
100
|
setattr(self, field, json.dumps(value))
|
101
|
+
elif field == "type":
|
102
|
+
setattr(self, field, value.value)
|
101
103
|
else:
|
102
104
|
setattr(self, field, value)
|
103
105
|
|
@@ -123,7 +125,7 @@ class FlavorSchema(NamedSchema, table=True):
|
|
123
125
|
"""
|
124
126
|
body = FlavorResponseBody(
|
125
127
|
user=self.user.to_model() if self.user else None,
|
126
|
-
type=self.type,
|
128
|
+
type=StackComponentType(self.type),
|
127
129
|
integration=self.integration,
|
128
130
|
logo_url=self.logo_url,
|
129
131
|
created=self.created,
|
@@ -17,6 +17,7 @@ from datetime import datetime
|
|
17
17
|
from typing import TYPE_CHECKING, Any, Dict, List, Optional, cast
|
18
18
|
from uuid import UUID
|
19
19
|
|
20
|
+
from pydantic import ConfigDict
|
20
21
|
from sqlalchemy import BOOLEAN, INTEGER, TEXT, Column
|
21
22
|
from sqlmodel import Field, Relationship
|
22
23
|
|
@@ -206,7 +207,7 @@ class ModelSchema(NamedSchema, table=True):
|
|
206
207
|
Returns:
|
207
208
|
The updated `ModelSchema`.
|
208
209
|
"""
|
209
|
-
for field, value in model_update.
|
210
|
+
for field, value in model_update.model_dump(
|
210
211
|
exclude_unset=True, exclude_none=True
|
211
212
|
).items():
|
212
213
|
setattr(self, field, value)
|
@@ -286,6 +287,14 @@ class ModelVersionSchema(NamedSchema, table=True):
|
|
286
287
|
),
|
287
288
|
)
|
288
289
|
|
290
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
291
|
+
# fields defined under base models. If not handled, this raises a warning.
|
292
|
+
# It is possible to suppress this warning message with the following
|
293
|
+
# configuration, however the ultimate solution is to rename these fields.
|
294
|
+
# Even though they do not cause any problems right now, if we are not
|
295
|
+
# careful we might overwrite some fields protected by pydantic.
|
296
|
+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
|
297
|
+
|
289
298
|
@classmethod
|
290
299
|
def from_request(
|
291
300
|
cls, model_version_request: ModelVersionRequest
|
@@ -498,6 +507,14 @@ class ModelVersionArtifactSchema(BaseSchema, table=True):
|
|
498
507
|
sa_column=Column(BOOLEAN, nullable=True)
|
499
508
|
)
|
500
509
|
|
510
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
511
|
+
# fields defined under base models. If not handled, this raises a warning.
|
512
|
+
# It is possible to suppress this warning message with the following
|
513
|
+
# configuration, however the ultimate solution is to rename these fields.
|
514
|
+
# Even though they do not cause any problems right now, if we are not
|
515
|
+
# careful we might overwrite some fields protected by pydantic.
|
516
|
+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
|
517
|
+
|
501
518
|
@classmethod
|
502
519
|
def from_request(
|
503
520
|
cls,
|
@@ -614,6 +631,14 @@ class ModelVersionPipelineRunSchema(BaseSchema, table=True):
|
|
614
631
|
back_populates="model_versions_pipeline_runs_links"
|
615
632
|
)
|
616
633
|
|
634
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
635
|
+
# fields defined under base models. If not handled, this raises a warning.
|
636
|
+
# It is possible to suppress this warning message with the following
|
637
|
+
# configuration, however the ultimate solution is to rename these fields.
|
638
|
+
# Even though they do not cause any problems right now, if we are not
|
639
|
+
# careful we might overwrite some fields protected by pydantic.
|
640
|
+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
|
641
|
+
|
617
642
|
@classmethod
|
618
643
|
def from_request(
|
619
644
|
cls,
|
@@ -17,7 +17,6 @@ import json
|
|
17
17
|
from typing import Any, Optional
|
18
18
|
from uuid import UUID
|
19
19
|
|
20
|
-
from pydantic.json import pydantic_encoder
|
21
20
|
from sqlalchemy import Column, String
|
22
21
|
from sqlalchemy.dialects.mysql import MEDIUMTEXT
|
23
22
|
from sqlmodel import Field, Relationship
|
@@ -29,6 +28,7 @@ from zenml.models import (
|
|
29
28
|
PipelineBuildResponseBody,
|
30
29
|
PipelineBuildResponseMetadata,
|
31
30
|
)
|
31
|
+
from zenml.utils.json_utils import pydantic_encoder
|
32
32
|
from zenml.zen_stores.schemas.base_schemas import BaseSchema
|
33
33
|
from zenml.zen_stores.schemas.pipeline_schemas import PipelineSchema
|
34
34
|
from zenml.zen_stores.schemas.schema_utils import build_foreign_key_field
|
@@ -17,7 +17,6 @@ import json
|
|
17
17
|
from typing import TYPE_CHECKING, Any, List, Optional
|
18
18
|
from uuid import UUID
|
19
19
|
|
20
|
-
from pydantic.json import pydantic_encoder
|
21
20
|
from sqlalchemy import TEXT, Column, String
|
22
21
|
from sqlalchemy.dialects.mysql import MEDIUMTEXT
|
23
22
|
from sqlmodel import Field, Relationship
|
@@ -31,6 +30,7 @@ from zenml.models import (
|
|
31
30
|
PipelineDeploymentResponseBody,
|
32
31
|
PipelineDeploymentResponseMetadata,
|
33
32
|
)
|
33
|
+
from zenml.utils.json_utils import pydantic_encoder
|
34
34
|
from zenml.zen_stores.schemas.base_schemas import BaseSchema
|
35
35
|
from zenml.zen_stores.schemas.code_repository_schemas import (
|
36
36
|
CodeReferenceSchema,
|
@@ -178,7 +178,7 @@ class PipelineDeploymentSchema(BaseSchema, table=True):
|
|
178
178
|
schedule_id=request.schedule,
|
179
179
|
code_reference_id=code_reference_id,
|
180
180
|
run_name_template=request.run_name_template,
|
181
|
-
pipeline_configuration=request.pipeline_configuration.
|
181
|
+
pipeline_configuration=request.pipeline_configuration.model_dump_json(),
|
182
182
|
step_configurations=json.dumps(
|
183
183
|
request.step_configurations,
|
184
184
|
sort_keys=False,
|
@@ -206,12 +206,12 @@ class PipelineDeploymentSchema(BaseSchema, table=True):
|
|
206
206
|
Returns:
|
207
207
|
The created `PipelineDeploymentResponse`.
|
208
208
|
"""
|
209
|
-
pipeline_configuration = PipelineConfiguration.
|
209
|
+
pipeline_configuration = PipelineConfiguration.model_validate_json(
|
210
210
|
self.pipeline_configuration
|
211
211
|
)
|
212
212
|
step_configurations = json.loads(self.step_configurations)
|
213
213
|
for s, c in step_configurations.items():
|
214
|
-
step_configurations[s] = Step.
|
214
|
+
step_configurations[s] = Step.model_validate(c)
|
215
215
|
|
216
216
|
body = PipelineDeploymentResponseBody(
|
217
217
|
user=self.user.to_model() if self.user else None,
|
@@ -70,7 +70,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
70
70
|
orchestrator_run_id: Optional[str] = Field(nullable=True)
|
71
71
|
start_time: Optional[datetime] = Field(nullable=True)
|
72
72
|
end_time: Optional[datetime] = Field(nullable=True, default=None)
|
73
|
-
status:
|
73
|
+
status: str = Field(nullable=False)
|
74
74
|
orchestrator_environment: Optional[str] = Field(
|
75
75
|
sa_column=Column(TEXT, nullable=True)
|
76
76
|
)
|
@@ -209,7 +209,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
209
209
|
orchestrator_run_id=request.orchestrator_run_id,
|
210
210
|
orchestrator_environment=orchestrator_environment,
|
211
211
|
start_time=request.start_time,
|
212
|
-
status=request.status,
|
212
|
+
status=request.status.value,
|
213
213
|
pipeline_id=request.pipeline,
|
214
214
|
deployment_id=request.deployment,
|
215
215
|
trigger_execution_id=request.trigger_execution_id,
|
@@ -259,7 +259,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
259
259
|
code_reference = deployment.code_reference
|
260
260
|
|
261
261
|
elif self.pipeline_configuration is not None:
|
262
|
-
config = PipelineConfiguration.
|
262
|
+
config = PipelineConfiguration.model_validate_json(
|
263
263
|
self.pipeline_configuration
|
264
264
|
)
|
265
265
|
client_environment = (
|
@@ -283,7 +283,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
283
283
|
|
284
284
|
body = PipelineRunResponseBody(
|
285
285
|
user=self.user.to_model() if self.user else None,
|
286
|
-
status=self.status,
|
286
|
+
status=ExecutionStatus(self.status),
|
287
287
|
stack=stack,
|
288
288
|
pipeline=pipeline,
|
289
289
|
build=build,
|
@@ -339,7 +339,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
339
339
|
The updated `PipelineRunSchema`.
|
340
340
|
"""
|
341
341
|
if run_update.status:
|
342
|
-
self.status = run_update.status
|
342
|
+
self.status = run_update.status.value
|
343
343
|
self.end_time = run_update.end_time
|
344
344
|
|
345
345
|
self.updated = datetime.utcnow()
|
@@ -384,7 +384,7 @@ class PipelineRunSchema(NamedSchema, table=True):
|
|
384
384
|
|
385
385
|
self.orchestrator_run_id = request.orchestrator_run_id
|
386
386
|
self.orchestrator_environment = orchestrator_environment
|
387
|
-
self.status = request.status
|
387
|
+
self.status = request.status.value
|
388
388
|
|
389
389
|
self.updated = datetime.utcnow()
|
390
390
|
|
@@ -13,6 +13,7 @@
|
|
13
13
|
# permissions and limitations under the License.
|
14
14
|
"""SQL Model Implementations for Pipelines and Pipeline Runs."""
|
15
15
|
|
16
|
+
import json
|
16
17
|
from datetime import datetime
|
17
18
|
from typing import TYPE_CHECKING, Any, List, Optional
|
18
19
|
from uuid import UUID
|
@@ -117,7 +118,9 @@ class PipelineSchema(NamedSchema, table=True):
|
|
117
118
|
workspace_id=pipeline_request.workspace,
|
118
119
|
user_id=pipeline_request.user,
|
119
120
|
docstring=pipeline_request.docstring,
|
120
|
-
spec=
|
121
|
+
spec=json.dumps(
|
122
|
+
pipeline_request.spec.model_dump(mode="json"), sort_keys=True
|
123
|
+
),
|
121
124
|
)
|
122
125
|
|
123
126
|
def to_model(
|
@@ -150,7 +153,7 @@ class PipelineSchema(NamedSchema, table=True):
|
|
150
153
|
metadata = PipelineResponseMetadata(
|
151
154
|
workspace=self.workspace.to_model(),
|
152
155
|
version_hash=self.version_hash,
|
153
|
-
spec=PipelineSpec.
|
156
|
+
spec=PipelineSpec.model_validate_json(self.spec),
|
154
157
|
docstring=self.docstring,
|
155
158
|
)
|
156
159
|
|
@@ -109,7 +109,7 @@ class RunMetadataSchema(BaseSchema, table=True):
|
|
109
109
|
|
110
110
|
key: str
|
111
111
|
value: str = Field(sa_column=Column(TEXT, nullable=False))
|
112
|
-
type:
|
112
|
+
type: str
|
113
113
|
|
114
114
|
def to_model(
|
115
115
|
self,
|
@@ -134,7 +134,7 @@ class RunMetadataSchema(BaseSchema, table=True):
|
|
134
134
|
created=self.created,
|
135
135
|
updated=self.updated,
|
136
136
|
value=json.loads(self.value),
|
137
|
-
type=self.type,
|
137
|
+
type=MetadataTypeEnum(self.type),
|
138
138
|
)
|
139
139
|
metadata = None
|
140
140
|
if include_metadata:
|
@@ -55,7 +55,7 @@ class SecretSchema(NamedSchema, table=True):
|
|
55
55
|
|
56
56
|
__tablename__ = "secret"
|
57
57
|
|
58
|
-
scope:
|
58
|
+
scope: str
|
59
59
|
|
60
60
|
values: Optional[bytes] = Field(sa_column=Column(TEXT, nullable=True))
|
61
61
|
|
@@ -177,7 +177,7 @@ class SecretSchema(NamedSchema, table=True):
|
|
177
177
|
assert secret.user is not None, "User must be set for secret creation."
|
178
178
|
return cls(
|
179
179
|
name=secret.name,
|
180
|
-
scope=secret.scope,
|
180
|
+
scope=secret.scope.value,
|
181
181
|
workspace_id=secret.workspace,
|
182
182
|
user_id=secret.user,
|
183
183
|
# Don't store secret values implicitly in the secret. The
|
@@ -201,10 +201,13 @@ class SecretSchema(NamedSchema, table=True):
|
|
201
201
|
# Don't update the secret values implicitly in the secret. The
|
202
202
|
# SQL secret store will call `set_secret_values` to update the
|
203
203
|
# values separately if SQL is used as the secrets store.
|
204
|
-
for field, value in secret_update.
|
204
|
+
for field, value in secret_update.model_dump(
|
205
205
|
exclude_unset=True, exclude={"workspace", "user", "values"}
|
206
206
|
).items():
|
207
|
-
|
207
|
+
if field == "scope":
|
208
|
+
setattr(self, field, value.value)
|
209
|
+
else:
|
210
|
+
setattr(self, field, value)
|
208
211
|
|
209
212
|
self.updated = datetime.utcnow()
|
210
213
|
return self
|
@@ -239,7 +242,7 @@ class SecretSchema(NamedSchema, table=True):
|
|
239
242
|
user=self.user.to_model() if self.user else None,
|
240
243
|
created=self.created,
|
241
244
|
updated=self.updated,
|
242
|
-
scope=self.scope,
|
245
|
+
scope=SecretScope(self.scope),
|
243
246
|
)
|
244
247
|
return SecretResponse(
|
245
248
|
id=self.id,
|
@@ -56,7 +56,9 @@ class ServerSettingsSchema(SQLModel, table=True):
|
|
56
56
|
Returns:
|
57
57
|
The updated `ServerSettingsSchema`.
|
58
58
|
"""
|
59
|
-
for field, value in settings_update.
|
59
|
+
for field, value in settings_update.model_dump(
|
60
|
+
exclude_unset=True
|
61
|
+
).items():
|
60
62
|
if field == "onboarding_state":
|
61
63
|
if value is not None:
|
62
64
|
self.onboarding_state = json.dumps(value)
|
@@ -186,7 +186,7 @@ class ServiceConnectorSchema(NamedSchema, table=True):
|
|
186
186
|
Returns:
|
187
187
|
The updated `ServiceConnectorSchema`.
|
188
188
|
"""
|
189
|
-
for field, value in connector_update.
|
189
|
+
for field, value in connector_update.model_dump(
|
190
190
|
exclude_unset=False,
|
191
191
|
exclude={"workspace", "user", "secrets"},
|
192
192
|
).items():
|
@@ -19,6 +19,7 @@ from datetime import datetime
|
|
19
19
|
from typing import Any, Optional
|
20
20
|
from uuid import UUID
|
21
21
|
|
22
|
+
from pydantic import ConfigDict
|
22
23
|
from sqlalchemy import TEXT, Column
|
23
24
|
from sqlmodel import Field, Relationship
|
24
25
|
|
@@ -108,6 +109,14 @@ class ServiceSchema(NamedSchema, table=True):
|
|
108
109
|
back_populates="services",
|
109
110
|
)
|
110
111
|
|
112
|
+
# TODO: In Pydantic v2, the `model_` is a protected namespaces for all
|
113
|
+
# fields defined under base models. If not handled, this raises a warning.
|
114
|
+
# It is possible to suppress this warning message with the following
|
115
|
+
# configuration, however the ultimate solution is to rename these fields.
|
116
|
+
# Even though they do not cause any problems right now, if we are not
|
117
|
+
# careful we might overwrite some fields protected by pydantic.
|
118
|
+
model_config = ConfigDict(protected_namespaces=()) # type: ignore[assignment]
|
119
|
+
|
111
120
|
def to_model(
|
112
121
|
self,
|
113
122
|
include_metadata: bool = False,
|
@@ -181,7 +190,7 @@ class ServiceSchema(NamedSchema, table=True):
|
|
181
190
|
Returns:
|
182
191
|
The updated `ServiceSchema`.
|
183
192
|
"""
|
184
|
-
for field, value in update.
|
193
|
+
for field, value in update.model_dump(
|
185
194
|
exclude_unset=True, exclude_none=True
|
186
195
|
).items():
|
187
196
|
if field == "labels":
|
@@ -221,7 +230,7 @@ class ServiceSchema(NamedSchema, table=True):
|
|
221
230
|
workspace_id=service_request.workspace,
|
222
231
|
user_id=service_request.user,
|
223
232
|
service_source=service_request.service_source,
|
224
|
-
service_type=service_request.service_type.
|
233
|
+
service_type=service_request.service_type.model_dump_json(),
|
225
234
|
type=service_request.service_type.type,
|
226
235
|
flavor=service_request.service_type.flavor,
|
227
236
|
admin_state=service_request.admin_state,
|
@@ -119,7 +119,7 @@ class StackSchema(NamedSchema, table=True):
|
|
119
119
|
Returns:
|
120
120
|
The updated StackSchema.
|
121
121
|
"""
|
122
|
-
for field, value in stack_update.
|
122
|
+
for field, value in stack_update.model_dump(
|
123
123
|
exclude_unset=True, exclude={"workspace", "user"}
|
124
124
|
).items():
|
125
125
|
if field == "components":
|
@@ -27,8 +27,6 @@ from zenml.constants import MEDIUMTEXT_MAX_LENGTH
|
|
27
27
|
from zenml.enums import (
|
28
28
|
ExecutionStatus,
|
29
29
|
MetadataResourceTypes,
|
30
|
-
StepRunInputArtifactType,
|
31
|
-
StepRunOutputArtifactType,
|
32
30
|
)
|
33
31
|
from zenml.models import (
|
34
32
|
StepRunRequest,
|
@@ -61,7 +59,7 @@ class StepRunSchema(NamedSchema, table=True):
|
|
61
59
|
# Fields
|
62
60
|
start_time: Optional[datetime] = Field(nullable=True)
|
63
61
|
end_time: Optional[datetime] = Field(nullable=True)
|
64
|
-
status:
|
62
|
+
status: str = Field(nullable=False)
|
65
63
|
|
66
64
|
docstring: Optional[str] = Field(sa_column=Column(TEXT, nullable=True))
|
67
65
|
cache_key: Optional[str] = Field(nullable=True)
|
@@ -166,7 +164,7 @@ class StepRunSchema(NamedSchema, table=True):
|
|
166
164
|
user_id=request.user,
|
167
165
|
start_time=request.start_time,
|
168
166
|
end_time=request.end_time,
|
169
|
-
status=request.status,
|
167
|
+
status=request.status.value,
|
170
168
|
original_step_run_id=request.original_step_run_id,
|
171
169
|
pipeline_run_id=request.pipeline_run_id,
|
172
170
|
deployment_id=request.deployment,
|
@@ -215,11 +213,13 @@ class StepRunSchema(NamedSchema, table=True):
|
|
215
213
|
}
|
216
214
|
|
217
215
|
if self.deployment is not None:
|
218
|
-
full_step_config = Step.
|
216
|
+
full_step_config = Step.model_validate(
|
219
217
|
json.loads(self.deployment.step_configurations)[self.name]
|
220
218
|
)
|
221
219
|
elif self.step_configuration is not None:
|
222
|
-
full_step_config = Step.
|
220
|
+
full_step_config = Step.model_validate_json(
|
221
|
+
self.step_configuration
|
222
|
+
)
|
223
223
|
else:
|
224
224
|
raise RuntimeError(
|
225
225
|
"Step run model creation has failed. Each step run entry "
|
@@ -228,7 +228,7 @@ class StepRunSchema(NamedSchema, table=True):
|
|
228
228
|
|
229
229
|
body = StepRunResponseBody(
|
230
230
|
user=self.user.to_model() if self.user else None,
|
231
|
-
status=self.status,
|
231
|
+
status=ExecutionStatus(self.status),
|
232
232
|
inputs=input_artifacts,
|
233
233
|
outputs=output_artifacts,
|
234
234
|
created=self.created,
|
@@ -282,11 +282,11 @@ class StepRunSchema(NamedSchema, table=True):
|
|
282
282
|
Returns:
|
283
283
|
The updated step run schema.
|
284
284
|
"""
|
285
|
-
for key, value in step_update.
|
285
|
+
for key, value in step_update.model_dump(
|
286
286
|
exclude_unset=True, exclude_none=True
|
287
287
|
).items():
|
288
288
|
if key == "status":
|
289
|
-
self.status = value
|
289
|
+
self.status = value.value
|
290
290
|
if key == "end_time":
|
291
291
|
self.end_time = value
|
292
292
|
|
@@ -328,7 +328,7 @@ class StepRunInputArtifactSchema(SQLModel, table=True):
|
|
328
328
|
|
329
329
|
# Fields
|
330
330
|
name: str = Field(nullable=False, primary_key=True)
|
331
|
-
type:
|
331
|
+
type: str
|
332
332
|
|
333
333
|
# Foreign keys
|
334
334
|
step_id: UUID = build_foreign_key_field(
|
@@ -364,7 +364,7 @@ class StepRunOutputArtifactSchema(SQLModel, table=True):
|
|
364
364
|
|
365
365
|
# Fields
|
366
366
|
name: str
|
367
|
-
type:
|
367
|
+
type: str
|
368
368
|
|
369
369
|
# Foreign keys
|
370
370
|
step_id: UUID = build_foreign_key_field(
|
@@ -107,8 +107,12 @@ class TagSchema(NamedSchema, table=True):
|
|
107
107
|
Returns:
|
108
108
|
The updated `TagSchema`.
|
109
109
|
"""
|
110
|
-
for field, value in update.
|
111
|
-
|
110
|
+
for field, value in update.model_dump(exclude_unset=True).items():
|
111
|
+
if field == "color":
|
112
|
+
setattr(self, field, value.value)
|
113
|
+
else:
|
114
|
+
setattr(self, field, value)
|
115
|
+
|
112
116
|
self.updated = datetime.utcnow()
|
113
117
|
return self
|
114
118
|
|
@@ -19,7 +19,6 @@ from datetime import datetime
|
|
19
19
|
from typing import Any, List, Optional, cast
|
20
20
|
from uuid import UUID
|
21
21
|
|
22
|
-
from pydantic.json import pydantic_encoder
|
23
22
|
from sqlalchemy import TEXT, Column
|
24
23
|
from sqlmodel import Field, Relationship
|
25
24
|
|
@@ -37,6 +36,7 @@ from zenml.models import (
|
|
37
36
|
TriggerResponseResources,
|
38
37
|
TriggerUpdate,
|
39
38
|
)
|
39
|
+
from zenml.utils.json_utils import pydantic_encoder
|
40
40
|
from zenml.zen_stores.schemas.base_schemas import BaseSchema, NamedSchema
|
41
41
|
from zenml.zen_stores.schemas.event_source_schemas import EventSourceSchema
|
42
42
|
from zenml.zen_stores.schemas.schema_utils import build_foreign_key_field
|
@@ -121,7 +121,7 @@ class TriggerSchema(NamedSchema, table=True):
|
|
121
121
|
Returns:
|
122
122
|
The updated TriggerSchema.
|
123
123
|
"""
|
124
|
-
for field, value in trigger_update.
|
124
|
+
for field, value in trigger_update.model_dump(
|
125
125
|
exclude_unset=True,
|
126
126
|
exclude_none=True,
|
127
127
|
).items():
|
@@ -210,7 +210,7 @@ class UserSchema(NamedSchema, table=True):
|
|
210
210
|
Returns:
|
211
211
|
The updated `UserSchema`.
|
212
212
|
"""
|
213
|
-
for field, value in user_update.
|
213
|
+
for field, value in user_update.model_dump(exclude_unset=True).items():
|
214
214
|
if field == "old_password":
|
215
215
|
continue
|
216
216
|
|
@@ -241,7 +241,7 @@ class UserSchema(NamedSchema, table=True):
|
|
241
241
|
Returns:
|
242
242
|
The updated `UserSchema`.
|
243
243
|
"""
|
244
|
-
for field, value in service_account_update.
|
244
|
+
for field, value in service_account_update.model_dump(
|
245
245
|
exclude_none=True
|
246
246
|
).items():
|
247
247
|
setattr(self, field, value)
|
@@ -172,7 +172,9 @@ class WorkspaceSchema(NamedSchema, table=True):
|
|
172
172
|
Returns:
|
173
173
|
The updated `WorkspaceSchema`.
|
174
174
|
"""
|
175
|
-
for field, value in workspace_update.
|
175
|
+
for field, value in workspace_update.model_dump(
|
176
|
+
exclude_unset=True
|
177
|
+
).items():
|
176
178
|
setattr(self, field, value)
|
177
179
|
|
178
180
|
self.updated = datetime.utcnow()
|