Skip to content

Commit 660a2ce

Browse files
feat(api): api update
1 parent 8ebef36 commit 660a2ce

File tree

8 files changed

+271
-16
lines changed

8 files changed

+271
-16
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
configured_endpoints: 16
2-
openapi_spec_hash: 7c835c55ec387350b647a302c48edb9d
2+
openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247
33
config_hash: 0383360784fc87d799bad2be203142b5

src/openlayer/resources/commits/test_results.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def list(
6565
List the test results for a project commit (project version).
6666
6767
Args:
68-
include_archived: Include archived goals.
68+
include_archived: Filter for archived tests.
6969
7070
page: The page to return in a paginated query.
7171
@@ -149,7 +149,7 @@ async def list(
149149
List the test results for a project commit (project version).
150150
151151
Args:
152-
include_archived: Include archived goals.
152+
include_archived: Filter for archived tests.
153153
154154
page: The page to return in a paginated query.
155155

src/openlayer/resources/projects/tests.py

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Iterable, Optional
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -51,9 +52,51 @@ def create(
5152
*,
5253
description: Optional[object],
5354
name: str,
54-
subtype: str,
55+
subtype: Literal[
56+
"anomalousColumnCount",
57+
"characterLength",
58+
"classImbalanceRatio",
59+
"expectColumnAToBeInColumnB",
60+
"columnAverage",
61+
"columnDrift",
62+
"columnStatistic",
63+
"columnValuesMatch",
64+
"conflictingLabelRowCount",
65+
"containsPii",
66+
"containsValidUrl",
67+
"correlatedFeatureCount",
68+
"customMetricThreshold",
69+
"duplicateRowCount",
70+
"emptyFeature",
71+
"emptyFeatureCount",
72+
"driftedFeatureCount",
73+
"featureMissingValues",
74+
"featureValueValidation",
75+
"greatExpectations",
76+
"groupByColumnStatsCheck",
77+
"illFormedRowCount",
78+
"isCode",
79+
"isJson",
80+
"llmRubricThresholdV2",
81+
"labelDrift",
82+
"metricThreshold",
83+
"newCategoryCount",
84+
"newLabelCount",
85+
"nullRowCount",
86+
"rowCount",
87+
"ppScoreValueValidation",
88+
"quasiConstantFeature",
89+
"quasiConstantFeatureCount",
90+
"sqlQuery",
91+
"dtypeValidation",
92+
"sentenceLength",
93+
"sizeRatio",
94+
"specialCharactersRatio",
95+
"stringValidation",
96+
"trainValLeakageRowCount",
97+
],
5598
thresholds: Iterable[test_create_params.Threshold],
56-
type: str,
99+
type: Literal["integrity", "consistency", "performance"],
57100
archived: bool | NotGiven = NOT_GIVEN,
58101
delay_window: Optional[float] | NotGiven = NOT_GIVEN,
59102
evaluation_window: Optional[float] | NotGiven = NOT_GIVEN,
@@ -161,9 +204,51 @@ async def create(
161204
*,
162205
description: Optional[object],
163206
name: str,
164-
subtype: str,
207+
subtype: Literal[
208+
"anomalousColumnCount",
209+
"characterLength",
210+
"classImbalanceRatio",
211+
"expectColumnAToBeInColumnB",
212+
"columnAverage",
213+
"columnDrift",
214+
"columnStatistic",
215+
"columnValuesMatch",
216+
"conflictingLabelRowCount",
217+
"containsPii",
218+
"containsValidUrl",
219+
"correlatedFeatureCount",
220+
"customMetricThreshold",
221+
"duplicateRowCount",
222+
"emptyFeature",
223+
"emptyFeatureCount",
224+
"driftedFeatureCount",
225+
"featureMissingValues",
226+
"featureValueValidation",
227+
"greatExpectations",
228+
"groupByColumnStatsCheck",
229+
"illFormedRowCount",
230+
"isCode",
231+
"isJson",
232+
"llmRubricThresholdV2",
233+
"labelDrift",
234+
"metricThreshold",
235+
"newCategoryCount",
236+
"newLabelCount",
237+
"nullRowCount",
238+
"rowCount",
239+
"ppScoreValueValidation",
240+
"quasiConstantFeature",
241+
"quasiConstantFeatureCount",
242+
"sqlQuery",
243+
"dtypeValidation",
244+
"sentenceLength",
245+
"sizeRatio",
246+
"specialCharactersRatio",
247+
"stringValidation",
248+
"trainValLeakageRowCount",
249+
],
165250
thresholds: Iterable[test_create_params.Threshold],
166-
type: str,
251+
type: Literal["integrity", "consistency", "performance"],
167252
archived: bool | NotGiven = NOT_GIVEN,
168253
delay_window: Optional[float] | NotGiven = NOT_GIVEN,
169254
evaluation_window: Optional[float] | NotGiven = NOT_GIVEN,

src/openlayer/types/commits/test_result_list_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class TestResultListParams(TypedDict, total=False):
1313
include_archived: Annotated[bool, PropertyInfo(alias="includeArchived")]
14-
"""Include archived goals."""
14+
"""Filter for archived tests."""
1515

1616
page: int
1717
"""The page to return in a paginated query."""

src/openlayer/types/commits/test_result_list_response.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,57 @@ class ItemGoal(BaseModel):
7171
origin_project_version_id: Optional[str] = FieldInfo(alias="originProjectVersionId", default=None)
7272
"""The project version (commit) id where the test was created."""
7373

74-
subtype: str
74+
subtype: Literal[
75+
"anomalousColumnCount",
76+
"characterLength",
77+
"classImbalanceRatio",
78+
"expectColumnAToBeInColumnB",
79+
"columnAverage",
80+
"columnDrift",
81+
"columnStatistic",
82+
"columnValuesMatch",
83+
"conflictingLabelRowCount",
84+
"containsPii",
85+
"containsValidUrl",
86+
"correlatedFeatureCount",
87+
"customMetricThreshold",
88+
"duplicateRowCount",
89+
"emptyFeature",
90+
"emptyFeatureCount",
91+
"driftedFeatureCount",
92+
"featureMissingValues",
93+
"featureValueValidation",
94+
"greatExpectations",
95+
"groupByColumnStatsCheck",
96+
"illFormedRowCount",
97+
"isCode",
98+
"isJson",
99+
"llmRubricThresholdV2",
100+
"labelDrift",
101+
"metricThreshold",
102+
"newCategoryCount",
103+
"newLabelCount",
104+
"nullRowCount",
105+
"rowCount",
106+
"ppScoreValueValidation",
107+
"quasiConstantFeature",
108+
"quasiConstantFeatureCount",
109+
"sqlQuery",
110+
"dtypeValidation",
111+
"sentenceLength",
112+
"sizeRatio",
113+
"specialCharactersRatio",
114+
"stringValidation",
115+
"trainValLeakageRowCount",
116+
]
75117
"""The test subtype."""
76118

77119
suggested: bool
78120
"""Whether the test is suggested or user-created."""
79121

80122
thresholds: List[ItemGoalThreshold]
81123

82-
type: str
124+
type: Literal["integrity", "consistency", "performance"]
83125
"""The test type."""
84126

85127
archived: Optional[bool] = None

src/openlayer/types/inference_pipelines/test_result_list_response.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,57 @@ class ItemGoal(BaseModel):
7171
origin_project_version_id: Optional[str] = FieldInfo(alias="originProjectVersionId", default=None)
7272
"""The project version (commit) id where the test was created."""
7373

74-
subtype: str
74+
subtype: Literal[
75+
"anomalousColumnCount",
76+
"characterLength",
77+
"classImbalanceRatio",
78+
"expectColumnAToBeInColumnB",
79+
"columnAverage",
80+
"columnDrift",
81+
"columnStatistic",
82+
"columnValuesMatch",
83+
"conflictingLabelRowCount",
84+
"containsPii",
85+
"containsValidUrl",
86+
"correlatedFeatureCount",
87+
"customMetricThreshold",
88+
"duplicateRowCount",
89+
"emptyFeature",
90+
"emptyFeatureCount",
91+
"driftedFeatureCount",
92+
"featureMissingValues",
93+
"featureValueValidation",
94+
"greatExpectations",
95+
"groupByColumnStatsCheck",
96+
"illFormedRowCount",
97+
"isCode",
98+
"isJson",
99+
"llmRubricThresholdV2",
100+
"labelDrift",
101+
"metricThreshold",
102+
"newCategoryCount",
103+
"newLabelCount",
104+
"nullRowCount",
105+
"rowCount",
106+
"ppScoreValueValidation",
107+
"quasiConstantFeature",
108+
"quasiConstantFeatureCount",
109+
"sqlQuery",
110+
"dtypeValidation",
111+
"sentenceLength",
112+
"sizeRatio",
113+
"specialCharactersRatio",
114+
"stringValidation",
115+
"trainValLeakageRowCount",
116+
]
75117
"""The test subtype."""
76118

77119
suggested: bool
78120
"""Whether the test is suggested or user-created."""
79121

80122
thresholds: List[ItemGoalThreshold]
81123

82-
type: str
124+
type: Literal["integrity", "consistency", "performance"]
83125
"""The test type."""
84126

85127
archived: Optional[bool] = None

src/openlayer/types/projects/test_create_params.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,56 @@ class TestCreateParams(TypedDict, total=False):
1717
name: Required[str]
1818
"""The test name."""
1919

20-
subtype: Required[str]
20+
subtype: Required[
21+
Literal[
22+
"anomalousColumnCount",
23+
"characterLength",
24+
"classImbalanceRatio",
25+
"expectColumnAToBeInColumnB",
26+
"columnAverage",
27+
"columnDrift",
28+
"columnStatistic",
29+
"columnValuesMatch",
30+
"conflictingLabelRowCount",
31+
"containsPii",
32+
"containsValidUrl",
33+
"correlatedFeatureCount",
34+
"customMetricThreshold",
35+
"duplicateRowCount",
36+
"emptyFeature",
37+
"emptyFeatureCount",
38+
"driftedFeatureCount",
39+
"featureMissingValues",
40+
"featureValueValidation",
41+
"greatExpectations",
42+
"groupByColumnStatsCheck",
43+
"illFormedRowCount",
44+
"isCode",
45+
"isJson",
46+
"llmRubricThresholdV2",
47+
"labelDrift",
48+
"metricThreshold",
49+
"newCategoryCount",
50+
"newLabelCount",
51+
"nullRowCount",
52+
"rowCount",
53+
"ppScoreValueValidation",
54+
"quasiConstantFeature",
55+
"quasiConstantFeatureCount",
56+
"sqlQuery",
57+
"dtypeValidation",
58+
"sentenceLength",
59+
"sizeRatio",
60+
"specialCharactersRatio",
61+
"stringValidation",
62+
"trainValLeakageRowCount",
63+
]
64+
]
2165
"""The test subtype."""
2266

2367
thresholds: Required[Iterable[Threshold]]
2468

25-
type: Required[str]
69+
type: Required[Literal["integrity", "consistency", "performance"]]
2670
"""The test type."""
2771

2872
archived: bool

src/openlayer/types/projects/test_create_response.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,57 @@ class TestCreateResponse(BaseModel):
7070
origin_project_version_id: Optional[str] = FieldInfo(alias="originProjectVersionId", default=None)
7171
"""The project version (commit) id where the test was created."""
7272

73-
subtype: str
73+
subtype: Literal[
74+
"anomalousColumnCount",
75+
"characterLength",
76+
"classImbalanceRatio",
77+
"expectColumnAToBeInColumnB",
78+
"columnAverage",
79+
"columnDrift",
80+
"columnStatistic",
81+
"columnValuesMatch",
82+
"conflictingLabelRowCount",
83+
"containsPii",
84+
"containsValidUrl",
85+
"correlatedFeatureCount",
86+
"customMetricThreshold",
87+
"duplicateRowCount",
88+
"emptyFeature",
89+
"emptyFeatureCount",
90+
"driftedFeatureCount",
91+
"featureMissingValues",
92+
"featureValueValidation",
93+
"greatExpectations",
94+
"groupByColumnStatsCheck",
95+
"illFormedRowCount",
96+
"isCode",
97+
"isJson",
98+
"llmRubricThresholdV2",
99+
"labelDrift",
100+
"metricThreshold",
101+
"newCategoryCount",
102+
"newLabelCount",
103+
"nullRowCount",
104+
"rowCount",
105+
"ppScoreValueValidation",
106+
"quasiConstantFeature",
107+
"quasiConstantFeatureCount",
108+
"sqlQuery",
109+
"dtypeValidation",
110+
"sentenceLength",
111+
"sizeRatio",
112+
"specialCharactersRatio",
113+
"stringValidation",
114+
"trainValLeakageRowCount",
115+
]
74116
"""The test subtype."""
75117

76118
suggested: bool
77119
"""Whether the test is suggested or user-created."""
78120

79121
thresholds: List[Threshold]
80122

81-
type: str
123+
type: Literal["integrity", "consistency", "performance"]
82124
"""The test type."""
83125

84126
archived: Optional[bool] = None

0 commit comments

Comments
 (0)