2525 DeploymentHTTPError ,
2626 DeploymentNotFoundError ,
2727 DeploymentProvisionError ,
28- DeploymentSchemaNotFoundError ,
2928)
3029from zenml .enums import DeploymentStatus
3130from zenml .models import DeploymentResponse
@@ -45,25 +44,18 @@ def get_deployment_input_schema(
4544 The schema for the deployment's input parameters.
4645
4746 Raises:
48- DeploymentSchemaNotFoundError: If the deployment has no associated
49- snapshot, pipeline spec, or parameters schema.
47+ RuntimeError: If the deployment has no associated input schema.
5048 """
51- if not deployment .snapshot :
52- raise DeploymentSchemaNotFoundError (
53- f"Deployment { deployment .name } has no associated snapshot."
54- )
55-
56- if not deployment .snapshot .pipeline_spec :
57- raise DeploymentSchemaNotFoundError (
58- f"Deployment { deployment .name } has no associated pipeline spec."
59- )
49+ if (
50+ deployment .snapshot
51+ and deployment .snapshot .pipeline_spec
52+ and deployment .snapshot .pipeline_spec .input_schema
53+ ):
54+ return deployment .snapshot .pipeline_spec .input_schema
6055
61- if not deployment .snapshot .pipeline_spec .input_schema :
62- raise DeploymentSchemaNotFoundError (
63- f"Deployment { deployment .name } has no associated parameters schema."
64- )
65-
66- return deployment .snapshot .pipeline_spec .input_schema
56+ raise RuntimeError (
57+ f"Deployment { deployment .name } has no associated input schema."
58+ )
6759
6860
6961def get_deployment_output_schema (
@@ -78,25 +70,18 @@ def get_deployment_output_schema(
7870 The schema for the deployment's output parameters.
7971
8072 Raises:
81- DeploymentSchemaNotFoundError: If the deployment has no associated
82- snapshot, pipeline spec, or output schema.
73+ RuntimeError: If the deployment has no associated output schema.
8374 """
84- if not deployment .snapshot :
85- raise DeploymentSchemaNotFoundError (
86- f"Deployment { deployment .name } has no associated snapshot."
87- )
88-
89- if not deployment .snapshot .pipeline_spec :
90- raise DeploymentSchemaNotFoundError (
91- f"Deployment { deployment .name } has no associated pipeline spec."
92- )
93-
94- if not deployment .snapshot .pipeline_spec .output_schema :
95- raise DeploymentSchemaNotFoundError (
96- f"Deployment { deployment .name } has no associated output schema."
97- )
98-
99- return deployment .snapshot .pipeline_spec .output_schema
75+ if (
76+ deployment .snapshot
77+ and deployment .snapshot .pipeline_spec
78+ and deployment .snapshot .pipeline_spec .output_schema
79+ ):
80+ return deployment .snapshot .pipeline_spec .output_schema
81+
82+ raise RuntimeError (
83+ f"Deployment { deployment .name } has no associated output schema."
84+ )
10085
10186
10287def get_deployment_invocation_example (
0 commit comments