Skip to content

Commit 86b3753

Browse files
feat(api): api update
1 parent 9fa0fbf commit 86b3753

File tree

12 files changed

+520
-32
lines changed

12 files changed

+520
-32
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
configured_endpoints: 17
2-
openapi_spec_hash: 8827ead72aa0c635ccafac5e008fe247
1+
configured_endpoints: 18
2+
openapi_spec_hash: 4f09f95fd31c148d1be80b7e643346ce
33
config_hash: 30422a4611d93ca69e4f1aff60b9ddb5

api.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ Methods:
4242
Types:
4343

4444
```python
45-
from openlayer.types.projects import TestCreateResponse, TestListResponse
45+
from openlayer.types.projects import TestCreateResponse, TestUpdateResponse, TestListResponse
4646
```
4747

4848
Methods:
4949

5050
- <code title="post /projects/{projectId}/tests">client.projects.tests.<a href="./src/openlayer/resources/projects/tests.py">create</a>(project_id, \*\*<a href="src/openlayer/types/projects/test_create_params.py">params</a>) -> <a href="./src/openlayer/types/projects/test_create_response.py">TestCreateResponse</a></code>
51+
- <code title="put /projects/{projectId}/tests">client.projects.tests.<a href="./src/openlayer/resources/projects/tests.py">update</a>(project_id, \*\*<a href="src/openlayer/types/projects/test_update_params.py">params</a>) -> <a href="./src/openlayer/types/projects/test_update_response.py">TestUpdateResponse</a></code>
5152
- <code title="get /projects/{projectId}/tests">client.projects.tests.<a href="./src/openlayer/resources/projects/tests.py">list</a>(project_id, \*\*<a href="src/openlayer/types/projects/test_list_params.py">params</a>) -> <a href="./src/openlayer/types/projects/test_list_response.py">TestListResponse</a></code>
5253

5354
# Commits

src/openlayer/resources/projects/tests.py

+84-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
async_to_streamed_response_wrapper,
1919
)
2020
from ..._base_client import make_request_options
21-
from ...types.projects import test_list_params, test_create_params
21+
from ...types.projects import test_list_params, test_create_params, test_update_params
2222
from ...types.projects.test_list_response import TestListResponse
2323
from ...types.projects.test_create_response import TestCreateResponse
24+
from ...types.projects.test_update_response import TestUpdateResponse
2425

2526
__all__ = ["TestsResource", "AsyncTestsResource"]
2627

@@ -178,6 +179,41 @@ def create(
178179
cast_to=TestCreateResponse,
179180
)
180181

182+
def update(
183+
self,
184+
project_id: str,
185+
*,
186+
payloads: Iterable[test_update_params.Payload],
187+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
188+
# The extra values given here take precedence over values defined on the client or passed to this method.
189+
extra_headers: Headers | None = None,
190+
extra_query: Query | None = None,
191+
extra_body: Body | None = None,
192+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
193+
) -> TestUpdateResponse:
194+
"""
195+
Update tests.
196+
197+
Args:
198+
extra_headers: Send extra headers
199+
200+
extra_query: Add additional query parameters to the request
201+
202+
extra_body: Add additional JSON properties to the request
203+
204+
timeout: Override the client-level default timeout for this request, in seconds
205+
"""
206+
if not project_id:
207+
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
208+
return self._put(
209+
f"/projects/{project_id}/tests",
210+
body=maybe_transform({"payloads": payloads}, test_update_params.TestUpdateParams),
211+
options=make_request_options(
212+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
213+
),
214+
cast_to=TestUpdateResponse,
215+
)
216+
181217
def list(
182218
self,
183219
project_id: str,
@@ -400,6 +436,41 @@ async def create(
400436
cast_to=TestCreateResponse,
401437
)
402438

439+
async def update(
440+
self,
441+
project_id: str,
442+
*,
443+
payloads: Iterable[test_update_params.Payload],
444+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
445+
# The extra values given here take precedence over values defined on the client or passed to this method.
446+
extra_headers: Headers | None = None,
447+
extra_query: Query | None = None,
448+
extra_body: Body | None = None,
449+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
450+
) -> TestUpdateResponse:
451+
"""
452+
Update tests.
453+
454+
Args:
455+
extra_headers: Send extra headers
456+
457+
extra_query: Add additional query parameters to the request
458+
459+
extra_body: Add additional JSON properties to the request
460+
461+
timeout: Override the client-level default timeout for this request, in seconds
462+
"""
463+
if not project_id:
464+
raise ValueError(f"Expected a non-empty value for `project_id` but received {project_id!r}")
465+
return await self._put(
466+
f"/projects/{project_id}/tests",
467+
body=await async_maybe_transform({"payloads": payloads}, test_update_params.TestUpdateParams),
468+
options=make_request_options(
469+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
470+
),
471+
cast_to=TestUpdateResponse,
472+
)
473+
403474
async def list(
404475
self,
405476
project_id: str,
@@ -480,6 +551,9 @@ def __init__(self, tests: TestsResource) -> None:
480551
self.create = to_raw_response_wrapper(
481552
tests.create,
482553
)
554+
self.update = to_raw_response_wrapper(
555+
tests.update,
556+
)
483557
self.list = to_raw_response_wrapper(
484558
tests.list,
485559
)
@@ -492,6 +566,9 @@ def __init__(self, tests: AsyncTestsResource) -> None:
492566
self.create = async_to_raw_response_wrapper(
493567
tests.create,
494568
)
569+
self.update = async_to_raw_response_wrapper(
570+
tests.update,
571+
)
495572
self.list = async_to_raw_response_wrapper(
496573
tests.list,
497574
)
@@ -506,6 +583,9 @@ def __init__(self, tests: TestsResource) -> None:
506583
self.create = to_streamed_response_wrapper(
507584
tests.create,
508585
)
586+
self.update = to_streamed_response_wrapper(
587+
tests.update,
588+
)
509589
self.list = to_streamed_response_wrapper(
510590
tests.list,
511591
)
@@ -518,6 +598,9 @@ def __init__(self, tests: AsyncTestsResource) -> None:
518598
self.create = async_to_streamed_response_wrapper(
519599
tests.create,
520600
)
601+
self.update = async_to_streamed_response_wrapper(
602+
tests.update,
603+
)
521604
self.list = async_to_streamed_response_wrapper(
522605
tests.list,
523606
)

src/openlayer/types/commits/test_result_list_response.py

+44-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,55 @@ class ItemGoalThresholdInsightParameter(BaseModel):
1919

2020

2121
class ItemGoalThreshold(BaseModel):
22-
insight_name: Optional[str] = FieldInfo(alias="insightName", default=None)
22+
insight_name: Optional[
23+
Literal[
24+
"characterLength",
25+
"classImbalance",
26+
"expectColumnAToBeInColumnB",
27+
"columnAverage",
28+
"columnDrift",
29+
"columnValuesMatch",
30+
"confidenceDistribution",
31+
"conflictingLabelRowCount",
32+
"containsPii",
33+
"containsValidUrl",
34+
"correlatedFeatures",
35+
"customMetric",
36+
"duplicateRowCount",
37+
"emptyFeatures",
38+
"featureDrift",
39+
"featureProfile",
40+
"greatExpectations",
41+
"groupByColumnStatsCheck",
42+
"illFormedRowCount",
43+
"isCode",
44+
"isJson",
45+
"llmRubricV2",
46+
"labelDrift",
47+
"metrics",
48+
"newCategories",
49+
"newLabels",
50+
"nullRowCount",
51+
"ppScore",
52+
"quasiConstantFeatures",
53+
"sentenceLength",
54+
"sizeRatio",
55+
"specialCharacters",
56+
"stringValidation",
57+
"trainValLeakageRowCount",
58+
]
59+
] = FieldInfo(alias="insightName", default=None)
2360
"""The insight name to be evaluated."""
2461

2562
insight_parameters: Optional[List[ItemGoalThresholdInsightParameter]] = FieldInfo(
2663
alias="insightParameters", default=None
2764
)
28-
"""The insight parameters. Required only for some test subtypes."""
65+
"""The insight parameters.
66+
67+
Required only for some test subtypes. For example, for tests that require a
68+
column name, the insight parameters will be [{'name': 'column_name', 'value':
69+
'Age'}]
70+
"""
2971

3072
measurement: Optional[str] = None
3173
"""The measurement to be evaluated."""

src/openlayer/types/inference_pipelines/test_result_list_response.py

+44-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,55 @@ class ItemGoalThresholdInsightParameter(BaseModel):
1919

2020

2121
class ItemGoalThreshold(BaseModel):
22-
insight_name: Optional[str] = FieldInfo(alias="insightName", default=None)
22+
insight_name: Optional[
23+
Literal[
24+
"characterLength",
25+
"classImbalance",
26+
"expectColumnAToBeInColumnB",
27+
"columnAverage",
28+
"columnDrift",
29+
"columnValuesMatch",
30+
"confidenceDistribution",
31+
"conflictingLabelRowCount",
32+
"containsPii",
33+
"containsValidUrl",
34+
"correlatedFeatures",
35+
"customMetric",
36+
"duplicateRowCount",
37+
"emptyFeatures",
38+
"featureDrift",
39+
"featureProfile",
40+
"greatExpectations",
41+
"groupByColumnStatsCheck",
42+
"illFormedRowCount",
43+
"isCode",
44+
"isJson",
45+
"llmRubricV2",
46+
"labelDrift",
47+
"metrics",
48+
"newCategories",
49+
"newLabels",
50+
"nullRowCount",
51+
"ppScore",
52+
"quasiConstantFeatures",
53+
"sentenceLength",
54+
"sizeRatio",
55+
"specialCharacters",
56+
"stringValidation",
57+
"trainValLeakageRowCount",
58+
]
59+
] = FieldInfo(alias="insightName", default=None)
2360
"""The insight name to be evaluated."""
2461

2562
insight_parameters: Optional[List[ItemGoalThresholdInsightParameter]] = FieldInfo(
2663
alias="insightParameters", default=None
2764
)
28-
"""The insight parameters. Required only for some test subtypes."""
65+
"""The insight parameters.
66+
67+
Required only for some test subtypes. For example, for tests that require a
68+
column name, the insight parameters will be [{'name': 'column_name', 'value':
69+
'Age'}]
70+
"""
2971

3072
measurement: Optional[str] = None
3173
"""The measurement to be evaluated."""

src/openlayer/types/projects/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from .commit_list_params import CommitListParams as CommitListParams
77
from .test_create_params import TestCreateParams as TestCreateParams
88
from .test_list_response import TestListResponse as TestListResponse
9+
from .test_update_params import TestUpdateParams as TestUpdateParams
910
from .commit_create_params import CommitCreateParams as CommitCreateParams
1011
from .commit_list_response import CommitListResponse as CommitListResponse
1112
from .test_create_response import TestCreateResponse as TestCreateResponse
13+
from .test_update_response import TestUpdateResponse as TestUpdateResponse
1214
from .commit_create_response import CommitCreateResponse as CommitCreateResponse
1315
from .inference_pipeline_list_params import InferencePipelineListParams as InferencePipelineListParams
1416
from .inference_pipeline_create_params import InferencePipelineCreateParams as InferencePipelineCreateParams

src/openlayer/types/projects/test_create_params.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,56 @@ class ThresholdInsightParameter(TypedDict, total=False):
105105

106106

107107
class Threshold(TypedDict, total=False):
108-
insight_name: Annotated[str, PropertyInfo(alias="insightName")]
108+
insight_name: Annotated[
109+
Literal[
110+
"characterLength",
111+
"classImbalance",
112+
"expectColumnAToBeInColumnB",
113+
"columnAverage",
114+
"columnDrift",
115+
"columnValuesMatch",
116+
"confidenceDistribution",
117+
"conflictingLabelRowCount",
118+
"containsPii",
119+
"containsValidUrl",
120+
"correlatedFeatures",
121+
"customMetric",
122+
"duplicateRowCount",
123+
"emptyFeatures",
124+
"featureDrift",
125+
"featureProfile",
126+
"greatExpectations",
127+
"groupByColumnStatsCheck",
128+
"illFormedRowCount",
129+
"isCode",
130+
"isJson",
131+
"llmRubricV2",
132+
"labelDrift",
133+
"metrics",
134+
"newCategories",
135+
"newLabels",
136+
"nullRowCount",
137+
"ppScore",
138+
"quasiConstantFeatures",
139+
"sentenceLength",
140+
"sizeRatio",
141+
"specialCharacters",
142+
"stringValidation",
143+
"trainValLeakageRowCount",
144+
],
145+
PropertyInfo(alias="insightName"),
146+
]
109147
"""The insight name to be evaluated."""
110148

111149
insight_parameters: Annotated[
112150
Optional[Iterable[ThresholdInsightParameter]], PropertyInfo(alias="insightParameters")
113151
]
114-
"""The insight parameters. Required only for some test subtypes."""
152+
"""The insight parameters.
153+
154+
Required only for some test subtypes. For example, for tests that require a
155+
column name, the insight parameters will be [{'name': 'column_name', 'value':
156+
'Age'}]
157+
"""
115158

116159
measurement: str
117160
"""The measurement to be evaluated."""

src/openlayer/types/projects/test_create_response.py

+44-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,53 @@ class ThresholdInsightParameter(BaseModel):
1919

2020

2121
class Threshold(BaseModel):
22-
insight_name: Optional[str] = FieldInfo(alias="insightName", default=None)
22+
insight_name: Optional[
23+
Literal[
24+
"characterLength",
25+
"classImbalance",
26+
"expectColumnAToBeInColumnB",
27+
"columnAverage",
28+
"columnDrift",
29+
"columnValuesMatch",
30+
"confidenceDistribution",
31+
"conflictingLabelRowCount",
32+
"containsPii",
33+
"containsValidUrl",
34+
"correlatedFeatures",
35+
"customMetric",
36+
"duplicateRowCount",
37+
"emptyFeatures",
38+
"featureDrift",
39+
"featureProfile",
40+
"greatExpectations",
41+
"groupByColumnStatsCheck",
42+
"illFormedRowCount",
43+
"isCode",
44+
"isJson",
45+
"llmRubricV2",
46+
"labelDrift",
47+
"metrics",
48+
"newCategories",
49+
"newLabels",
50+
"nullRowCount",
51+
"ppScore",
52+
"quasiConstantFeatures",
53+
"sentenceLength",
54+
"sizeRatio",
55+
"specialCharacters",
56+
"stringValidation",
57+
"trainValLeakageRowCount",
58+
]
59+
] = FieldInfo(alias="insightName", default=None)
2360
"""The insight name to be evaluated."""
2461

2562
insight_parameters: Optional[List[ThresholdInsightParameter]] = FieldInfo(alias="insightParameters", default=None)
26-
"""The insight parameters. Required only for some test subtypes."""
63+
"""The insight parameters.
64+
65+
Required only for some test subtypes. For example, for tests that require a
66+
column name, the insight parameters will be [{'name': 'column_name', 'value':
67+
'Age'}]
68+
"""
2769

2870
measurement: Optional[str] = None
2971
"""The measurement to be evaluated."""

0 commit comments

Comments
 (0)