dyff-schema 0.2.2__tar.gz → 0.3.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.2.2 → dyff-schema-0.3.0}/.gitlab-ci.yml +3 -2
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/.pre-commit-config.yaml +11 -4
- {dyff-schema-0.2.2/dyff_schema.egg-info → dyff-schema-0.3.0}/PKG-INFO +1 -1
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/ids.py +6 -7
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/quantity.py +1 -2
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/adapters.py +19 -21
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/base.py +13 -14
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/__init__.py +2 -1
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/arrow.py +15 -20
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/platform.py +380 -67
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/requests.py +40 -7
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/test.py +12 -7
- {dyff-schema-0.2.2 → dyff-schema-0.3.0/dyff_schema.egg-info}/PKG-INFO +1 -1
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/.gitignore +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/.licenserc.yaml +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/.prettierignore +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/.secrets.baseline +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/CODE_OF_CONDUCT.md +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/LICENSE +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/NOTICE +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/README.md +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/adapters.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/base.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/copydoc.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/arrow.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/binary.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/classification.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/text.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/dataset/vision.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/io/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/io/vllm.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/platform.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/py.typed +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/requests.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/test.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/binary.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/classification.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/text.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/dataset/vision.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/io/__init__.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/io/vllm.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/v0/r1/version.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff/schema/version.py +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff_schema.egg-info/SOURCES.txt +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff_schema.egg-info/dependency_links.txt +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff_schema.egg-info/requires.txt +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/dyff_schema.egg-info/top_level.txt +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/makefile +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/pyproject.toml +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/setup.cfg +0 -0
- {dyff-schema-0.2.2 → dyff-schema-0.3.0}/tests/test_import.py +0 -0
|
@@ -16,11 +16,11 @@ include:
|
|
|
16
16
|
file:
|
|
17
17
|
- detect-secrets.yml
|
|
18
18
|
- project: buildgarden/pipelines/prettier
|
|
19
|
-
ref: 0.2
|
|
19
|
+
ref: 0.3.2
|
|
20
20
|
file:
|
|
21
21
|
- prettier.yml
|
|
22
22
|
- project: buildgarden/pipelines/python
|
|
23
|
-
ref: 0.
|
|
23
|
+
ref: 0.9.1
|
|
24
24
|
file:
|
|
25
25
|
- python-autoflake.yml
|
|
26
26
|
- python-black.yml
|
|
@@ -31,6 +31,7 @@ include:
|
|
|
31
31
|
- python-pyroma.yml
|
|
32
32
|
- python-pytest.yml
|
|
33
33
|
- python-twine-upload.yml
|
|
34
|
+
- python-docformatter.yml
|
|
34
35
|
- project: buildgarden/pipelines/skywalking-eyes
|
|
35
36
|
ref: 0.2.0
|
|
36
37
|
file:
|
|
@@ -12,7 +12,7 @@ repos:
|
|
|
12
12
|
- id: trailing-whitespace
|
|
13
13
|
|
|
14
14
|
- repo: https://github.com/PyCQA/autoflake
|
|
15
|
-
rev: "v2.3.
|
|
15
|
+
rev: "v2.3.1"
|
|
16
16
|
hooks:
|
|
17
17
|
- id: autoflake
|
|
18
18
|
args:
|
|
@@ -23,7 +23,7 @@ repos:
|
|
|
23
23
|
# - "--remove-all-unused-imports"
|
|
24
24
|
|
|
25
25
|
- repo: https://github.com/psf/black
|
|
26
|
-
rev: 24.
|
|
26
|
+
rev: 24.3.0
|
|
27
27
|
hooks:
|
|
28
28
|
- id: black
|
|
29
29
|
|
|
@@ -32,6 +32,13 @@ repos:
|
|
|
32
32
|
hooks:
|
|
33
33
|
- id: isort
|
|
34
34
|
|
|
35
|
+
- repo: https://github.com/PyCQA/docformatter
|
|
36
|
+
rev: v1.7.5
|
|
37
|
+
hooks:
|
|
38
|
+
- id: docformatter
|
|
39
|
+
additional_dependencies: [tomli]
|
|
40
|
+
args: ["--in-place", "--black", "--config", "./pyproject.toml"]
|
|
41
|
+
|
|
35
42
|
- repo: https://gitlab.com/buildgarden/pipelines/skywalking-eyes
|
|
36
43
|
rev: "0.2.0"
|
|
37
44
|
hooks:
|
|
@@ -44,12 +51,12 @@ repos:
|
|
|
44
51
|
exclude: "^\\.gitlab-ci\\.yml$"
|
|
45
52
|
|
|
46
53
|
- repo: https://gitlab.com/buildgarden/tools/badgie
|
|
47
|
-
rev: "0.
|
|
54
|
+
rev: "0.12.0"
|
|
48
55
|
hooks:
|
|
49
56
|
- id: badgie
|
|
50
57
|
|
|
51
58
|
- repo: https://gitlab.com/buildgarden/tools/cici-tools
|
|
52
|
-
rev: "0.
|
|
59
|
+
rev: "0.7.0"
|
|
53
60
|
hooks:
|
|
54
61
|
- id: cici-update
|
|
55
62
|
|
|
@@ -14,9 +14,9 @@ def generate_entity_id() -> str:
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def null_id() -> str:
|
|
17
|
-
"""Return a special identifier signifying that the identity of an entity
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
"""Return a special identifier signifying that the identity of an entity is not
|
|
18
|
+
important. Used for entities that are "owned" by another entity that has a non-null
|
|
19
|
+
identifier.
|
|
20
20
|
|
|
21
21
|
:returns: The null identifier -- a hex string representation of a UUID.
|
|
22
22
|
:rtype: str
|
|
@@ -25,10 +25,9 @@ def null_id() -> str:
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def replication_id(evaluation_id: str, replication_index: int) -> str:
|
|
28
|
-
"""Return a unique identifier for a replication within an evaluation.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
collisions.
|
|
28
|
+
"""Return a unique identifier for a replication within an evaluation. Replications
|
|
29
|
+
in different evaluations will have different identifiers, so datasets from different
|
|
30
|
+
evaluations can be combined without worrying about collisions.
|
|
32
31
|
|
|
33
32
|
:param evaluation_id: The ID of the Evaluation.
|
|
34
33
|
:type evaluation_id: str
|
|
@@ -22,8 +22,7 @@ from typing import Any
|
|
|
22
22
|
# See the License for the specific language governing permissions and
|
|
23
23
|
# limitations under the License.
|
|
24
24
|
def parse_quantity(quantity: Any) -> Decimal:
|
|
25
|
-
"""Parse a kubernetes canonical form quantity like 200Mi to a decimal
|
|
26
|
-
number.
|
|
25
|
+
"""Parse a kubernetes canonical form quantity like 200Mi to a decimal number.
|
|
27
26
|
|
|
28
27
|
Supported SI suffixes:
|
|
29
28
|
base1024: Ki | Mi | Gi | Ti | Pi | Ei
|
|
@@ -15,10 +15,9 @@ from dyff.schema.platform import SchemaAdapter
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def map_structure(fn, data):
|
|
18
|
-
"""Given a JSON data structure ``data``, create a new data structure
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"""
|
|
18
|
+
"""Given a JSON data structure ``data``, create a new data structure instance with
|
|
19
|
+
the same shape as ``data`` by applying ``fn`` to each "leaf" value in the nested
|
|
20
|
+
data structure."""
|
|
22
21
|
if isinstance(data, dict):
|
|
23
22
|
return {k: map_structure(fn, v) for k, v in data.items()}
|
|
24
23
|
elif isinstance(data, list):
|
|
@@ -30,10 +29,10 @@ def map_structure(fn, data):
|
|
|
30
29
|
def flatten_object(
|
|
31
30
|
obj: dict, *, max_depth: int | None = None, add_prefix: bool = True
|
|
32
31
|
) -> dict:
|
|
33
|
-
"""Flatten a JSON object the by creating a new object with a key for
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
"""Flatten a JSON object the by creating a new object with a key for each "leaf"
|
|
33
|
+
value in the input. If ``add_prefix`` is True, the key will be equal to the "path"
|
|
34
|
+
string of the leaf, i.e., "obj.field.subfield"; otherwise, it will be just
|
|
35
|
+
"subfield".
|
|
37
36
|
|
|
38
37
|
Nested lists are considered "leaf" values, even if they contain objects.
|
|
39
38
|
"""
|
|
@@ -72,8 +71,8 @@ class Adapter(Protocol):
|
|
|
72
71
|
|
|
73
72
|
|
|
74
73
|
class TransformJSON:
|
|
75
|
-
"""Transform an input JSON structure by creating a new output JSON
|
|
76
|
-
|
|
74
|
+
"""Transform an input JSON structure by creating a new output JSON structure where
|
|
75
|
+
all of the "leaf" values are populated by either:
|
|
77
76
|
|
|
78
77
|
1. A provided JSON literal value, or
|
|
79
78
|
2. The result of a jsonpath query on the input structure.
|
|
@@ -158,8 +157,8 @@ class TransformJSON:
|
|
|
158
157
|
|
|
159
158
|
|
|
160
159
|
class EmbedIndex:
|
|
161
|
-
"""Adds one or more fields to each member of the specified collections
|
|
162
|
-
|
|
160
|
+
"""Adds one or more fields to each member of the specified collections that
|
|
161
|
+
represent "indexes", or possible sort orders, for the collections.
|
|
163
162
|
|
|
164
163
|
For example, if the input data is::
|
|
165
164
|
|
|
@@ -232,11 +231,10 @@ class EmbedIndex:
|
|
|
232
231
|
|
|
233
232
|
|
|
234
233
|
class ExplodeCollections:
|
|
235
|
-
"""Explodes one or more top-level lists of the same length into multiple
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
rows with a unique index.
|
|
234
|
+
"""Explodes one or more top-level lists of the same length into multiple records,
|
|
235
|
+
where each record contains the corresponding value from each list. This is useful
|
|
236
|
+
for turning nested-list representations into "relational" representations where the
|
|
237
|
+
lists are converted to multiple rows with a unique index.
|
|
240
238
|
|
|
241
239
|
The ``configuration`` argument is a dictionary::
|
|
242
240
|
|
|
@@ -341,8 +339,8 @@ class ExplodeCollections:
|
|
|
341
339
|
|
|
342
340
|
|
|
343
341
|
class FlattenHierarchy:
|
|
344
|
-
"""Flatten a JSON object -- or the JSON sub-objects in named fields -- by
|
|
345
|
-
|
|
342
|
+
"""Flatten a JSON object -- or the JSON sub-objects in named fields -- by creating a
|
|
343
|
+
new object with a key for each "leaf" value in the input.
|
|
346
344
|
|
|
347
345
|
The ``configuration`` options are::
|
|
348
346
|
|
|
@@ -464,8 +462,8 @@ class Select:
|
|
|
464
462
|
|
|
465
463
|
|
|
466
464
|
class Map:
|
|
467
|
-
"""For each input item, map another Adapter over the elements of each of
|
|
468
|
-
|
|
465
|
+
"""For each input item, map another Adapter over the elements of each of the named
|
|
466
|
+
nested collections within that item.
|
|
469
467
|
|
|
470
468
|
The configuration is a dictionary::
|
|
471
469
|
|
|
@@ -147,7 +147,7 @@ class FixedWidthNumberMeta(
|
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
class DType:
|
|
150
|
-
"""Base class for pydantic custom types that have an Arrow .dtype"""
|
|
150
|
+
"""Base class for pydantic custom types that have an Arrow .dtype."""
|
|
151
151
|
|
|
152
152
|
@classmethod
|
|
153
153
|
def __modify_schema__(
|
|
@@ -240,35 +240,35 @@ class UInt64Meta(FixedWidthNumberMeta[int, pydantic.ConstrainedInt]):
|
|
|
240
240
|
|
|
241
241
|
|
|
242
242
|
class Int8(FixedWidthInt, metaclass=Int8Meta):
|
|
243
|
-
"""An 8-bit integer"""
|
|
243
|
+
"""An 8-bit integer."""
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
class Int16(FixedWidthInt, metaclass=Int16Meta):
|
|
247
|
-
"""A 16-bit integer"""
|
|
247
|
+
"""A 16-bit integer."""
|
|
248
248
|
|
|
249
249
|
|
|
250
250
|
class Int32(FixedWidthInt, metaclass=Int32Meta):
|
|
251
|
-
"""A 32-bit integer"""
|
|
251
|
+
"""A 32-bit integer."""
|
|
252
252
|
|
|
253
253
|
|
|
254
254
|
class Int64(FixedWidthInt, metaclass=Int64Meta):
|
|
255
|
-
"""A 64-bit integer"""
|
|
255
|
+
"""A 64-bit integer."""
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
class UInt8(FixedWidthInt, metaclass=UInt8Meta):
|
|
259
|
-
"""An 8-bit unsigned integer"""
|
|
259
|
+
"""An 8-bit unsigned integer."""
|
|
260
260
|
|
|
261
261
|
|
|
262
262
|
class UInt16(FixedWidthInt, metaclass=UInt16Meta):
|
|
263
|
-
"""A 16-bit unsigned integer"""
|
|
263
|
+
"""A 16-bit unsigned integer."""
|
|
264
264
|
|
|
265
265
|
|
|
266
266
|
class UInt32(FixedWidthInt, metaclass=UInt32Meta):
|
|
267
|
-
"""A 32-bit unsigned integer"""
|
|
267
|
+
"""A 32-bit unsigned integer."""
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
class UInt64(FixedWidthInt, metaclass=UInt64Meta):
|
|
271
|
-
"""A 64-bit unsigned integer"""
|
|
271
|
+
"""A 64-bit unsigned integer."""
|
|
272
272
|
|
|
273
273
|
|
|
274
274
|
# ----------------------------------------------------------------------------
|
|
@@ -557,11 +557,10 @@ def list_(
|
|
|
557
557
|
class DyffSchemaBaseModel(pydantic.BaseModel):
|
|
558
558
|
"""Base class for pydantic models that used for defining data schemas.
|
|
559
559
|
|
|
560
|
-
Overrides serialization functions to serialize by alias, so that
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
field names.
|
|
560
|
+
Overrides serialization functions to serialize by alias, so that "round-trip"
|
|
561
|
+
serialization is the default for fields with aliases. We prefer aliases because we
|
|
562
|
+
can 1) use _underscore_names_ as reserved names in our data schema, and 2) allow
|
|
563
|
+
Python reserved words like 'bytes' as field names.
|
|
565
564
|
"""
|
|
566
565
|
|
|
567
566
|
def dict(self, *, by_alias: bool = True, **kwargs) -> dict[str, Any]:
|
|
@@ -56,7 +56,8 @@ def make_item_type(schema: Type[DyffSchemaBaseModel]) -> Type[DyffSchemaBaseMode
|
|
|
56
56
|
def make_response_item_type(
|
|
57
57
|
schema: Type[DyffSchemaBaseModel],
|
|
58
58
|
) -> Type[DyffSchemaBaseModel]:
|
|
59
|
-
"""Return a pydantic model type that inherits from both ``ResponseItem`` and
|
|
59
|
+
"""Return a pydantic model type that inherits from both ``ResponseItem`` and
|
|
60
|
+
``schema``."""
|
|
60
61
|
return pydantic.create_model(
|
|
61
62
|
f"{schema.__name__}ResponseItem", __base__=(schema, ResponseItem)
|
|
62
63
|
)
|
|
@@ -28,31 +28,28 @@ def arrow_schema(
|
|
|
28
28
|
) -> pyarrow.Schema:
|
|
29
29
|
"""Create an Arrow schema from a Pydantic model.
|
|
30
30
|
|
|
31
|
-
We support a very basic subset of pydantic model features currently. The
|
|
32
|
-
|
|
31
|
+
We support a very basic subset of pydantic model features currently. The intention
|
|
32
|
+
is to expand this.
|
|
33
33
|
"""
|
|
34
34
|
arrow_fields = [arrow_field(field) for _, field in model_type.__fields__.items()]
|
|
35
35
|
return pyarrow.schema(arrow_fields, metadata=metadata)
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def make_item_schema(schema: pyarrow.Schema) -> pyarrow.Schema:
|
|
39
|
-
"""Given an Arrow schema, create a new one that has the extra ``Item``
|
|
40
|
-
|
|
41
|
-
"""
|
|
39
|
+
"""Given an Arrow schema, create a new one that has the extra ``Item`` fields
|
|
40
|
+
added."""
|
|
42
41
|
return schema.insert(0, pyarrow.field("_index_", pyarrow.int64()))
|
|
43
42
|
|
|
44
43
|
|
|
45
44
|
def make_response_item_schema(schema: pyarrow.Schema) -> pyarrow.Schema:
|
|
46
|
-
"""Given an Arrow schema, create a new one that has the extra
|
|
47
|
-
|
|
48
|
-
"""
|
|
45
|
+
"""Given an Arrow schema, create a new one that has the extra ``ResponseItem``
|
|
46
|
+
fields added."""
|
|
49
47
|
return schema.insert(0, pyarrow.field("_response_index_", pyarrow.int64()))
|
|
50
48
|
|
|
51
49
|
|
|
52
50
|
def make_response_schema(schema: pyarrow.Schema) -> pyarrow.Schema:
|
|
53
|
-
"""Given an Arrow schema, create a new one that has the extra
|
|
54
|
-
|
|
55
|
-
"""
|
|
51
|
+
"""Given an Arrow schema, create a new one that has the extra ``ResponseItem``
|
|
52
|
+
fields added."""
|
|
56
53
|
response_item_schema = make_response_item_schema(schema)
|
|
57
54
|
fields = list(zip(response_item_schema.names, response_item_schema.types))
|
|
58
55
|
item_type = pyarrow.struct(fields)
|
|
@@ -90,9 +87,9 @@ def subset_schema(schema: pyarrow.Schema, field_names: list[str]) -> pyarrow.Sch
|
|
|
90
87
|
def arrow_type(annotation: type):
|
|
91
88
|
"""Determine a suitable arrow type for a pydantic model field.
|
|
92
89
|
|
|
93
|
-
Supports primitive types as well as pydantic sub-models, lists, and
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
Supports primitive types as well as pydantic sub-models, lists, and optional types.
|
|
91
|
+
Numeric types must have appropriate bounds specified, as Arrow cannot represent the
|
|
92
|
+
unbounded integer types used by Python 3.
|
|
96
93
|
"""
|
|
97
94
|
if origin := typing.get_origin(annotation):
|
|
98
95
|
if origin == list:
|
|
@@ -176,9 +173,8 @@ def field_with_docstring(
|
|
|
176
173
|
*,
|
|
177
174
|
docstring: str | None = None,
|
|
178
175
|
) -> pyarrow.Field:
|
|
179
|
-
"""Wrapper for ``pyarrow.field()`` that adds a docstring in the ``__doc__``
|
|
180
|
-
|
|
181
|
-
"""
|
|
176
|
+
"""Wrapper for ``pyarrow.field()`` that adds a docstring in the ``__doc__`` property
|
|
177
|
+
of ``metadata``."""
|
|
182
178
|
if metadata:
|
|
183
179
|
metadata_with_docstring = metadata.copy()
|
|
184
180
|
if docstring:
|
|
@@ -192,9 +188,8 @@ def field_with_docstring(
|
|
|
192
188
|
|
|
193
189
|
|
|
194
190
|
def schema_function(schema: pyarrow.Schema):
|
|
195
|
-
"""Annotation for functions that return ``pyarrow.Schema``. The annotated
|
|
196
|
-
|
|
197
|
-
describing the schema.
|
|
191
|
+
"""Annotation for functions that return ``pyarrow.Schema``. The annotated function
|
|
192
|
+
will return the supplied schema and will have a docstring describing the schema.
|
|
198
193
|
|
|
199
194
|
Intended to be applied to a function with no body, e.g.:
|
|
200
195
|
|