dyff-schema 0.26.0__py3-none-any.whl → 0.26.1__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.
Potentially problematic release.
This version of dyff-schema might be problematic. Click here for more details.
- dyff/schema/v0/r1/commands.py +21 -21
- dyff/schema/v0/r1/requests.py +43 -27
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/METADATA +1 -1
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/RECORD +8 -8
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/LICENSE +0 -0
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/NOTICE +0 -0
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/WHEEL +0 -0
- {dyff_schema-0.26.0.dist-info → dyff_schema-0.26.1.dist-info}/top_level.txt +0 -0
dyff/schema/v0/r1/commands.py
CHANGED
|
@@ -51,7 +51,7 @@ class FamilyIdentifier(EntityIdentifier):
|
|
|
51
51
|
kind: Literal["Family"] = "Family"
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
class Command(SchemaVersion):
|
|
54
|
+
class Command(SchemaVersion, DyffSchemaBaseModel):
|
|
55
55
|
"""Base class for Command messages.
|
|
56
56
|
|
|
57
57
|
Commands define the API of the "command model" in our CQRS architecture.
|
|
@@ -95,17 +95,17 @@ class CreateEntity(Command):
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
class EditEntityDocumentationPatch(DyffSchemaBaseModel):
|
|
98
|
-
"""Same properties as DocumentationBase, but
|
|
99
|
-
|
|
98
|
+
"""Same properties as DocumentationBase, but assigning None to a field is
|
|
99
|
+
interpreted as a command to delete that field.
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
"delete that field".
|
|
101
|
+
Fields that are assigned explicitly remain unchanged.
|
|
103
102
|
"""
|
|
104
103
|
|
|
105
104
|
title: Optional[Union[pydantic.constr(max_length=title_maxlen()), Null]] = ( # type: ignore
|
|
106
105
|
pydantic.Field(
|
|
107
106
|
default=None,
|
|
108
|
-
description='A short plain string suitable as a title or "headline".'
|
|
107
|
+
description='A short plain string suitable as a title or "headline".'
|
|
108
|
+
" Providing an explicit None value deletes the current value.",
|
|
109
109
|
)
|
|
110
110
|
)
|
|
111
111
|
|
|
@@ -113,19 +113,22 @@ class EditEntityDocumentationPatch(DyffSchemaBaseModel):
|
|
|
113
113
|
pydantic.Field(
|
|
114
114
|
default=None,
|
|
115
115
|
description="A brief summary, suitable for display in"
|
|
116
|
-
" small UI elements.
|
|
117
|
-
"
|
|
116
|
+
" small UI elements. Providing an explicit None value deletes the"
|
|
117
|
+
" current value.",
|
|
118
118
|
)
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
fullPage: Optional[Union[str, Null]] = pydantic.Field(
|
|
122
122
|
default=None,
|
|
123
123
|
description="Long-form documentation. Interpreted as"
|
|
124
|
-
" Markdown. There are no length constraints, but be reasonable."
|
|
124
|
+
" Markdown. There are no length constraints, but be reasonable."
|
|
125
|
+
" Providing an explicit None value deletes the current value.",
|
|
125
126
|
)
|
|
126
127
|
|
|
127
128
|
|
|
128
129
|
class EditEntityDocumentationAttributes(DyffSchemaBaseModel):
|
|
130
|
+
"""Attributes for the EditEntityDocumentation command."""
|
|
131
|
+
|
|
129
132
|
documentation: EditEntityDocumentationPatch = pydantic.Field(
|
|
130
133
|
description="Edits to make to the documentation."
|
|
131
134
|
)
|
|
@@ -155,18 +158,13 @@ class EditEntityDocumentation(Command):
|
|
|
155
158
|
|
|
156
159
|
|
|
157
160
|
class EditEntityLabelsAttributes(DyffSchemaBaseModel):
|
|
161
|
+
"""Attributes for the EditEntityLabels command."""
|
|
162
|
+
|
|
158
163
|
labels: dict[LabelKeyType, Optional[Union[LabelValueType, Null]]] = pydantic.Field(
|
|
159
164
|
default_factory=dict,
|
|
160
|
-
description="A set of key-value labels for the resource.
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"The keys are DNS labels with an optional DNS domain prefix."
|
|
164
|
-
" For example: 'my-key', 'your.com/key_0'. Keys prefixed with"
|
|
165
|
-
" 'dyff.io/', 'subdomain.dyff.io/', etc. are reserved.\n\n"
|
|
166
|
-
"The label values are alphanumeric characters separated by"
|
|
167
|
-
" '.', '-', or '_'.\n\n"
|
|
168
|
-
"We follow the kubernetes label conventions closely."
|
|
169
|
-
" See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels",
|
|
165
|
+
description="A set of key-value labels for the resource."
|
|
166
|
+
" Existing label keys that are not provided in the edit remain unchanged."
|
|
167
|
+
" Providing an explicit None value deletes the corresponding key.",
|
|
170
168
|
)
|
|
171
169
|
|
|
172
170
|
|
|
@@ -194,7 +192,7 @@ class EditEntityLabels(Command):
|
|
|
194
192
|
|
|
195
193
|
|
|
196
194
|
class EditFamilyMembersAttributes(DyffSchemaBaseModel):
|
|
197
|
-
"""
|
|
195
|
+
"""Attributes for the EditFamilyMembers command."""
|
|
198
196
|
|
|
199
197
|
members: dict[TagNameType, Optional[Union[FamilyMember, Null]]] = pydantic.Field(
|
|
200
198
|
description="Mapping of names to IDs of member resources.",
|
|
@@ -236,11 +234,13 @@ class ForgetEntity(Command):
|
|
|
236
234
|
|
|
237
235
|
|
|
238
236
|
class UpdateEntityStatusAttributes(DyffSchemaBaseModel):
|
|
237
|
+
"""Attributes for the UpdateEntityStatus command."""
|
|
238
|
+
|
|
239
239
|
status: str = pydantic.Field(
|
|
240
240
|
description=Status.__fields__["status"].field_info.description
|
|
241
241
|
)
|
|
242
242
|
|
|
243
|
-
reason: Union[str, Null] = pydantic.Field(
|
|
243
|
+
reason: Optional[Union[str, Null]] = pydantic.Field(
|
|
244
244
|
description=Status.__fields__["reason"].field_info.description
|
|
245
245
|
)
|
|
246
246
|
|
dyff/schema/v0/r1/requests.py
CHANGED
|
@@ -16,11 +16,12 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import re
|
|
18
18
|
from datetime import datetime
|
|
19
|
-
from typing import Literal, Optional, Union
|
|
19
|
+
from typing import Any, Literal, Optional, Union
|
|
20
20
|
|
|
21
21
|
import pydantic
|
|
22
22
|
|
|
23
|
-
from .
|
|
23
|
+
from . import commands
|
|
24
|
+
from .base import DyffBaseModel
|
|
24
25
|
from .platform import (
|
|
25
26
|
AnalysisBase,
|
|
26
27
|
AnalysisScope,
|
|
@@ -30,10 +31,8 @@ from .platform import (
|
|
|
30
31
|
DocumentationBase,
|
|
31
32
|
EvaluationBase,
|
|
32
33
|
FamilyBase,
|
|
33
|
-
FamilyMembers,
|
|
34
34
|
InferenceServiceBase,
|
|
35
35
|
InferenceSessionBase,
|
|
36
|
-
Labeled,
|
|
37
36
|
MethodBase,
|
|
38
37
|
ModelSpec,
|
|
39
38
|
ModuleBase,
|
|
@@ -43,6 +42,9 @@ from .platform import (
|
|
|
43
42
|
)
|
|
44
43
|
from .version import SchemaVersion
|
|
45
44
|
|
|
45
|
+
# mypy gets confused because 'dict' is the name of a method in DyffBaseModel
|
|
46
|
+
_ModelAsDict = dict[str, Any]
|
|
47
|
+
|
|
46
48
|
|
|
47
49
|
class DyffRequestDefaultValidators(DyffBaseModel):
|
|
48
50
|
"""This must be the base class for *all* request models in the Dyff schema.
|
|
@@ -62,7 +64,19 @@ class DyffRequestDefaultValidators(DyffBaseModel):
|
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
class DyffRequestBase(SchemaVersion, DyffRequestDefaultValidators):
|
|
65
|
-
|
|
67
|
+
# TODO: (DYFF-223) I think that exclude_unset=True should be the default
|
|
68
|
+
# for all schema objects, but I'm unsure of the consequences of making
|
|
69
|
+
# this change and we'll defer it until v1.
|
|
70
|
+
def dict(
|
|
71
|
+
self, *, by_alias: bool = True, exclude_unset=True, **kwargs
|
|
72
|
+
) -> _ModelAsDict:
|
|
73
|
+
return super().dict(by_alias=by_alias, exclude_unset=exclude_unset, **kwargs)
|
|
74
|
+
|
|
75
|
+
def json(self, *, by_alias: bool = True, exclude_unset=True, **kwargs) -> str:
|
|
76
|
+
return super().json(by_alias=by_alias, exclude_unset=exclude_unset, **kwargs)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# ----------------------------------------------------------------------------
|
|
66
80
|
|
|
67
81
|
|
|
68
82
|
class DyffEntityCreateRequest(DyffRequestBase):
|
|
@@ -124,26 +138,6 @@ class DatasetCreateRequest(DyffEntityCreateRequest, DatasetBase):
|
|
|
124
138
|
pass
|
|
125
139
|
|
|
126
140
|
|
|
127
|
-
class DocumentationEditRequest(DyffRequestBase, DocumentationBase):
|
|
128
|
-
@pydantic.validator("title", check_fields=False)
|
|
129
|
-
def _validate_title(cls, title: Optional[str]) -> Optional[str]:
|
|
130
|
-
# TODO: This has to be a validator function because we can't apply the
|
|
131
|
-
# contraint to DocumentationBase, since there are already entities
|
|
132
|
-
# that violate the constraints in the data store. Fix in Schema v1.
|
|
133
|
-
if title is not None and len(title) > title_maxlen():
|
|
134
|
-
raise ValueError(f".title must have length < {title_maxlen()}")
|
|
135
|
-
return title
|
|
136
|
-
|
|
137
|
-
@pydantic.validator("summary", check_fields=False)
|
|
138
|
-
def _validate_summary(cls, summary: Optional[str]) -> Optional[str]:
|
|
139
|
-
# TODO: This has to be a validator function because we can't apply the
|
|
140
|
-
# contraint to DocumentationBase, since there are already entities
|
|
141
|
-
# that violate the constraints in the data store. Fix in Schema v1.
|
|
142
|
-
if summary is not None and len(summary) > summary_maxlen():
|
|
143
|
-
raise ValueError(f".summary must have length < {summary_maxlen()}")
|
|
144
|
-
return summary
|
|
145
|
-
|
|
146
|
-
|
|
147
141
|
class InferenceServiceCreateRequest(DyffEntityCreateRequest, InferenceServiceBase):
|
|
148
142
|
model: Optional[str] = pydantic.Field(
|
|
149
143
|
default=None, description="ID of Model backing the service, if applicable"
|
|
@@ -239,14 +233,35 @@ class ReportCreateRequest(DyffEntityCreateRequest, ReportBase):
|
|
|
239
233
|
)
|
|
240
234
|
|
|
241
235
|
|
|
242
|
-
|
|
236
|
+
# ----------------------------------------------------------------------------
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class DocumentationEditRequest(
|
|
240
|
+
DyffRequestBase, commands.EditEntityDocumentationAttributes
|
|
241
|
+
):
|
|
243
242
|
pass
|
|
244
243
|
|
|
245
244
|
|
|
246
|
-
class
|
|
245
|
+
class FamilyMembersEditRequest(DyffRequestBase, commands.EditFamilyMembersAttributes):
|
|
247
246
|
pass
|
|
248
247
|
|
|
249
248
|
|
|
249
|
+
class LabelsEditRequest(DyffRequestBase, commands.EditEntityLabelsAttributes):
|
|
250
|
+
pass
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class LabelUpdateRequest(LabelsEditRequest):
|
|
254
|
+
"""Deprecated alias for LabelsEditRequest.
|
|
255
|
+
|
|
256
|
+
.. deprecated:: 0.26.0
|
|
257
|
+
|
|
258
|
+
Use LabelsEditRequest
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
# ----------------------------------------------------------------------------
|
|
263
|
+
|
|
264
|
+
|
|
250
265
|
# Note: Query requests, as they currently exist, don't work with Versioned
|
|
251
266
|
# because fastapi will assign None to every field that the client doesn't
|
|
252
267
|
# specify. I think it's not that important, because all of the query parameters
|
|
@@ -418,6 +433,7 @@ __all__ = [
|
|
|
418
433
|
"InferenceSessionQueryRequest",
|
|
419
434
|
"InferenceSessionTokenCreateRequest",
|
|
420
435
|
"LabelUpdateRequest",
|
|
436
|
+
"LabelsEditRequest",
|
|
421
437
|
"MeasurementQueryRequest",
|
|
422
438
|
"MethodCreateRequest",
|
|
423
439
|
"MethodQueryRequest",
|
|
@@ -25,9 +25,9 @@ dyff/schema/v0/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
|
25
25
|
dyff/schema/v0/r1/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
26
26
|
dyff/schema/v0/r1/adapters.py,sha256=dmQS2ecgDX4ZvTMOW-6NzV_Oq_UpaiyFd7QnSNoOnK8,33057
|
|
27
27
|
dyff/schema/v0/r1/base.py,sha256=OW05Wn2ZHBpeutj2sx93jcD1cz4kLzRvRZ_y2dS53lo,20206
|
|
28
|
-
dyff/schema/v0/r1/commands.py,sha256=
|
|
28
|
+
dyff/schema/v0/r1/commands.py,sha256=6PjAEylAsFml_0WQzXX4K4VkxoKx1stMI7u2vQXRv5c,8939
|
|
29
29
|
dyff/schema/v0/r1/platform.py,sha256=ndOu5kOfkQOjfFQ0bX8sp0IvMO1xcVMmpWU0LMQeS88,80754
|
|
30
|
-
dyff/schema/v0/r1/requests.py,sha256=
|
|
30
|
+
dyff/schema/v0/r1/requests.py,sha256=ZoaT_g7dPKIWtibWJFwlbuMJ2dXqIkS8h9mJ-7VnLr4,15789
|
|
31
31
|
dyff/schema/v0/r1/test.py,sha256=X6dUyVd5svcPCI-PBMOAqEfK9jv3bRDvkQTJzwS96c0,10720
|
|
32
32
|
dyff/schema/v0/r1/version.py,sha256=isKAGuGxsdru8vDaYmI4YiZdJOu_wNxXK7u6QzD6FE4,392
|
|
33
33
|
dyff/schema/v0/r1/dataset/__init__.py,sha256=LbVlkO2asyGYBKk2z49xjJYTM-pu9y9e4eQDXgTDLnM,2553
|
|
@@ -39,9 +39,9 @@ dyff/schema/v0/r1/dataset/text.py,sha256=nLIn91Zlt0tNdXUklSgjJ-kEDxoPX32ISLkiv2D
|
|
|
39
39
|
dyff/schema/v0/r1/dataset/vision.py,sha256=aIe0fbfM_g3DsrDTdg2K803YKLjZBpurM_VJcJFuZLc,369
|
|
40
40
|
dyff/schema/v0/r1/io/__init__.py,sha256=L5y8UhRnojerPYHumsxQJRcHCNz8Hj9NM8b47mewMNs,92
|
|
41
41
|
dyff/schema/v0/r1/io/vllm.py,sha256=CUE9y8KthtUI7sD49S875rDmPvKotSXVIRaBS79aBZs,5320
|
|
42
|
-
dyff_schema-0.26.
|
|
43
|
-
dyff_schema-0.26.
|
|
44
|
-
dyff_schema-0.26.
|
|
45
|
-
dyff_schema-0.26.
|
|
46
|
-
dyff_schema-0.26.
|
|
47
|
-
dyff_schema-0.26.
|
|
42
|
+
dyff_schema-0.26.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
43
|
+
dyff_schema-0.26.1.dist-info/METADATA,sha256=Skxf1x8Wu90es2D635GUPEMqvLmevpi2dZM25MQC7I8,3482
|
|
44
|
+
dyff_schema-0.26.1.dist-info/NOTICE,sha256=YONACu0s_Ui6jNi-wtEsVQbTU1JIkh8wvLH6d1-Ni_w,43
|
|
45
|
+
dyff_schema-0.26.1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
46
|
+
dyff_schema-0.26.1.dist-info/top_level.txt,sha256=9e3VVdeX73t_sUJOPQPCcGtYO1JhoErhHIi3WoWGcFI,5
|
|
47
|
+
dyff_schema-0.26.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|