dyff-schema 0.26.2__tar.gz → 0.27.0__tar.gz
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-0.26.2/dyff_schema.egg-info → dyff_schema-0.27.0}/PKG-INFO +1 -1
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/base.py +10 -7
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/commands.py +35 -15
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/platform.py +4 -3
- {dyff_schema-0.26.2 → dyff_schema-0.27.0/dyff_schema.egg-info}/PKG-INFO +1 -1
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.gitignore +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.gitlab-ci.yml +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.licenserc.yaml +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.pre-commit-config.yaml +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.prettierignore +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/.secrets.baseline +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/CODE_OF_CONDUCT.md +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/LICENSE +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/NOTICE +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/README.md +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/adapters.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/annotations.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/base.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/commands.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/copydoc.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/arrow.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/binary.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/classification.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/embedding.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/text.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/dataset/vision.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/errors.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/ids.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/io/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/io/vllm.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/platform.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/py.typed +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/quantity.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/requests.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/test.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/adapters.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/arrow.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/binary.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/classification.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/embedding.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/text.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/dataset/vision.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/io/__init__.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/io/vllm.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/requests.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/test.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/v0/r1/version.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff/schema/version.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff_schema.egg-info/SOURCES.txt +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff_schema.egg-info/dependency_links.txt +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff_schema.egg-info/requires.txt +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/dyff_schema.egg-info/top_level.txt +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/makefile +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/pyproject.toml +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/setup.cfg +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/tests/test_adapters.py +0 -0
- {dyff_schema-0.26.2 → dyff_schema-0.27.0}/tests/test_import.py +0 -0
|
@@ -599,17 +599,20 @@ class DyffBaseModel(pydantic.BaseModel):
|
|
|
599
599
|
# TODO: (DYFF-223) I think that exclude_unset=True should be the default
|
|
600
600
|
# for all schema objects, but I'm unsure of the consequences of making
|
|
601
601
|
# this change and we'll defer it until v1.
|
|
602
|
-
def dict(
|
|
603
|
-
|
|
602
|
+
def dict(
|
|
603
|
+
self, *, by_alias: bool = True, exclude_none: bool = True, **kwargs
|
|
604
|
+
) -> _ModelAsDict:
|
|
605
|
+
return super().dict(by_alias=by_alias, exclude_none=exclude_none, **kwargs)
|
|
604
606
|
|
|
605
|
-
def json(
|
|
606
|
-
|
|
607
|
+
def json(
|
|
608
|
+
self, *, by_alias: bool = True, exclude_none: bool = True, **kwargs
|
|
609
|
+
) -> str:
|
|
610
|
+
return super().json(by_alias=by_alias, exclude_none=exclude_none, **kwargs)
|
|
607
611
|
|
|
608
612
|
def model_dump(
|
|
609
613
|
self,
|
|
610
614
|
*,
|
|
611
615
|
mode: Literal["python", "json"] = "python",
|
|
612
|
-
by_alias: bool = True,
|
|
613
616
|
**kwargs,
|
|
614
617
|
) -> _ModelAsDict:
|
|
615
618
|
"""Encode the object as a dict containing only JSON datatypes.
|
|
@@ -621,9 +624,9 @@ class DyffBaseModel(pydantic.BaseModel):
|
|
|
621
624
|
we convert to Pydantic 2. See: DYFF-223
|
|
622
625
|
"""
|
|
623
626
|
if mode == "python":
|
|
624
|
-
return self.dict(
|
|
627
|
+
return self.dict(**kwargs)
|
|
625
628
|
else:
|
|
626
|
-
return json.loads(self.json(
|
|
629
|
+
return json.loads(self.json(**kwargs))
|
|
627
630
|
|
|
628
631
|
|
|
629
632
|
# Note: I *really* wanted to require datetimes to have timezones, like in
|
|
@@ -33,6 +33,37 @@ from .platform import (
|
|
|
33
33
|
_ModelAsDict = dict[str, Any]
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
class _JsonMergePatchSemantics(DyffSchemaBaseModel):
|
|
37
|
+
"""Explicit None values will be output as json 'null', and fields that are not set
|
|
38
|
+
explicitly are not output.
|
|
39
|
+
|
|
40
|
+
In JSON Merge Patch terms, None means "delete this field", and not setting a value
|
|
41
|
+
means "leave this field unchanged".
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def dict(self, *, by_alias: bool = True, **kwargs) -> _ModelAsDict:
|
|
45
|
+
return super().dict(
|
|
46
|
+
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def json(self, *, by_alias: bool = True, **kwargs) -> str:
|
|
50
|
+
return super().json(
|
|
51
|
+
by_alias=by_alias, exclude_unset=True, exclude_none=False, **kwargs
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# class _NoneMeansUndefined(DyffSchemaBaseModel):
|
|
56
|
+
# """Fields with the value None will not be emitted in the JSON output."""
|
|
57
|
+
|
|
58
|
+
# # TODO: (DYFF-223) This should perhaps be the default for all schema
|
|
59
|
+
# # objects.
|
|
60
|
+
# def dict(self, *, exclude_none=True, **kwargs) -> _ModelAsDict:
|
|
61
|
+
# return super().dict(exclude_none=True, **kwargs)
|
|
62
|
+
|
|
63
|
+
# def json(self, *, exclude_none=True, **kwargs) -> str:
|
|
64
|
+
# return super().json(exclude_none=True, **kwargs)
|
|
65
|
+
|
|
66
|
+
|
|
36
67
|
class EntityIdentifier(DyffSchemaBaseModel):
|
|
37
68
|
"""Identifies a single entity."""
|
|
38
69
|
|
|
@@ -71,17 +102,6 @@ class Command(SchemaVersion, DyffSchemaBaseModel):
|
|
|
71
102
|
"UpdateEntityStatus",
|
|
72
103
|
]
|
|
73
104
|
|
|
74
|
-
# TODO: (DYFF-223) I think that exclude_unset=True should be the default
|
|
75
|
-
# for all schema objects, but I'm unsure of the consequences of making
|
|
76
|
-
# this change and we'll defer it until v1.
|
|
77
|
-
def dict(
|
|
78
|
-
self, *, by_alias: bool = True, exclude_unset=True, **kwargs
|
|
79
|
-
) -> _ModelAsDict:
|
|
80
|
-
return super().dict(by_alias=by_alias, exclude_unset=exclude_unset, **kwargs)
|
|
81
|
-
|
|
82
|
-
def json(self, *, by_alias: bool = True, exclude_unset=True, **kwargs) -> str:
|
|
83
|
-
return super().json(by_alias=by_alias, exclude_unset=exclude_unset, **kwargs)
|
|
84
|
-
|
|
85
105
|
|
|
86
106
|
# ----------------------------------------------------------------------------
|
|
87
107
|
|
|
@@ -99,7 +119,7 @@ class CreateEntity(Command):
|
|
|
99
119
|
# ----------------------------------------------------------------------------
|
|
100
120
|
|
|
101
121
|
|
|
102
|
-
class EditEntityDocumentationPatch(
|
|
122
|
+
class EditEntityDocumentationPatch(_JsonMergePatchSemantics):
|
|
103
123
|
"""Same properties as DocumentationBase, but assigning None to a field is
|
|
104
124
|
interpreted as a command to delete that field.
|
|
105
125
|
|
|
@@ -162,7 +182,7 @@ class EditEntityDocumentation(Command):
|
|
|
162
182
|
# ----------------------------------------------------------------------------
|
|
163
183
|
|
|
164
184
|
|
|
165
|
-
class EditEntityLabelsAttributes(
|
|
185
|
+
class EditEntityLabelsAttributes(_JsonMergePatchSemantics):
|
|
166
186
|
"""Attributes for the EditEntityLabels command."""
|
|
167
187
|
|
|
168
188
|
labels: dict[LabelKeyType, Optional[Union[LabelValueType, Null]]] = pydantic.Field(
|
|
@@ -196,7 +216,7 @@ class EditEntityLabels(Command):
|
|
|
196
216
|
# ----------------------------------------------------------------------------
|
|
197
217
|
|
|
198
218
|
|
|
199
|
-
class EditFamilyMembersAttributes(
|
|
219
|
+
class EditFamilyMembersAttributes(_JsonMergePatchSemantics):
|
|
200
220
|
"""Attributes for the EditFamilyMembers command."""
|
|
201
221
|
|
|
202
222
|
members: dict[TagNameType, Optional[Union[FamilyMember, Null]]] = pydantic.Field(
|
|
@@ -238,7 +258,7 @@ class ForgetEntity(Command):
|
|
|
238
258
|
# ----------------------------------------------------------------------------
|
|
239
259
|
|
|
240
260
|
|
|
241
|
-
class UpdateEntityStatusAttributes(
|
|
261
|
+
class UpdateEntityStatusAttributes(_JsonMergePatchSemantics):
|
|
242
262
|
"""Attributes for the UpdateEntityStatus command."""
|
|
243
263
|
|
|
244
264
|
status: str = pydantic.Field(
|
|
@@ -449,7 +449,7 @@ class DyffEntityMetadata(DyffSchemaBaseModel):
|
|
|
449
449
|
description="Unique identifier of the current revision of the entity.",
|
|
450
450
|
)
|
|
451
451
|
|
|
452
|
-
documentation:
|
|
452
|
+
documentation: DocumentationBase = pydantic.Field(
|
|
453
453
|
default_factory=DocumentationBase,
|
|
454
454
|
description="Documentation of the resource. The content is used to"
|
|
455
455
|
" populate various views in the web UI.",
|
|
@@ -493,7 +493,7 @@ class DyffEntity(Status, Labeled, SchemaVersion, DyffModelWithID):
|
|
|
493
493
|
)
|
|
494
494
|
|
|
495
495
|
creationTime: datetime = pydantic.Field(
|
|
496
|
-
|
|
496
|
+
description="Resource creation time (assigned by system)"
|
|
497
497
|
)
|
|
498
498
|
|
|
499
499
|
lastTransitionTime: Optional[datetime] = pydantic.Field(
|
|
@@ -728,8 +728,9 @@ class Family(DyffEntity, FamilyBase, FamilyMembers):
|
|
|
728
728
|
|
|
729
729
|
class RevisionMetadata(DyffSchemaBaseModel):
|
|
730
730
|
previousRevision: Optional[str] = pydantic.Field(
|
|
731
|
+
default=None,
|
|
731
732
|
description="The ID of the revision from which this revision was derived."
|
|
732
|
-
"If None, then this is the first revision of the entity."
|
|
733
|
+
"If None, then this is the first revision of the entity.",
|
|
733
734
|
)
|
|
734
735
|
creationTime: datetime = pydantic.Field(
|
|
735
736
|
description="The time when the Revision was created"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|