Skip to content

Commit b58c0c3

Browse files
Koladata Teamcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 715298680 Change-Id: I2d635fb0bcfaed1ef6cfe2d2f957aa22e6cdbb5a
1 parent 36386ef commit b58c0c3

File tree

1 file changed

+133
-73
lines changed

1 file changed

+133
-73
lines changed

docs/koda_v1_api_reference.md

Lines changed: 133 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,15 +4362,6 @@ Creates a Koda entity schema corresponding to the given Python type.
43624362
to derive the itemid for the uu-schema.
43634363
```
43644364

4365-
### `kd.schema.schema_from_py_type(tpe)` {#kd.schema.schema_from_py_type}
4366-
Aliases:
4367-
4368-
- [kd.schema_from_py_type](#kd.schema_from_py_type)
4369-
4370-
``` {.no-copy}
4371-
A deprecated alias for kd.schema.schema_from_py.
4372-
```
4373-
43744365
### `kd.schema.to_any(x)` {#kd.schema.to_any}
43754366

43764367
Alias for [kd.schema.as_any](#kd.schema.as_any) operator.
@@ -4967,6 +4958,24 @@ Returns:
49674958
A new DataSlice with items selected by indices.
49684959
```
49694960

4961+
### `kd.slices.bool(x)` {#kd.slices.bool}
4962+
Aliases:
4963+
4964+
- [kd.bool](#kd.bool)
4965+
4966+
``` {.no-copy}
4967+
Returns kd.slice(x, kd.BOOLEAN).
4968+
```
4969+
4970+
### `kd.slices.bytes(x)` {#kd.slices.bytes}
4971+
Aliases:
4972+
4973+
- [kd.bytes](#kd.bytes)
4974+
4975+
``` {.no-copy}
4976+
Returns kd.slice(x, kd.BYTES).
4977+
```
4978+
49704979
### `kd.slices.collapse(x, ndim=unspecified)` {#kd.slices.collapse}
49714980
Aliases:
49724981

@@ -5191,6 +5200,33 @@ Returns:
51915200
Expanded DataSlice
51925201
```
51935202

5203+
### `kd.slices.expr_quote(x)` {#kd.slices.expr_quote}
5204+
Aliases:
5205+
5206+
- [kd.expr_quote](#kd.expr_quote)
5207+
5208+
``` {.no-copy}
5209+
Returns kd.slice(x, kd.EXPR).
5210+
```
5211+
5212+
### `kd.slices.float32(x)` {#kd.slices.float32}
5213+
Aliases:
5214+
5215+
- [kd.float32](#kd.float32)
5216+
5217+
``` {.no-copy}
5218+
Returns kd.slice(x, kd.FLOAT32).
5219+
```
5220+
5221+
### `kd.slices.float64(x)` {#kd.slices.float64}
5222+
Aliases:
5223+
5224+
- [kd.float64](#kd.float64)
5225+
5226+
``` {.no-copy}
5227+
Returns kd.slice(x, kd.FLOAT64).
5228+
```
5229+
51945230
### `kd.slices.get_ndim(x)` {#kd.slices.get_ndim}
51955231
Aliases:
51965232

@@ -5396,6 +5432,24 @@ Args:
53965432
If dim < 0 then dim = get_ndim(x) + dim.
53975433
```
53985434

5435+
### `kd.slices.int32(x)` {#kd.slices.int32}
5436+
Aliases:
5437+
5438+
- [kd.int32](#kd.int32)
5439+
5440+
``` {.no-copy}
5441+
Returns kd.slice(x, kd.INT32).
5442+
```
5443+
5444+
### `kd.slices.int64(x)` {#kd.slices.int64}
5445+
Aliases:
5446+
5447+
- [kd.int64](#kd.int64)
5448+
5449+
``` {.no-copy}
5450+
Returns kd.slice(x, kd.INT64).
5451+
```
5452+
53995453
### `kd.slices.inverse_mapping(x, ndim=unspecified)` {#kd.slices.inverse_mapping}
54005454
Aliases:
54015455

@@ -5539,6 +5593,33 @@ Aliases:
55395593
Returns a DataItem indicating whether DataItem x is present in y.
55405594
```
55415595

5596+
### `kd.slices.item` {#kd.slices.item}
5597+
Aliases:
5598+
5599+
- [kd.item](#kd.item)
5600+
5601+
``` {.no-copy}
5602+
Returns a DataItem created from `x`.
5603+
5604+
If `schema` is set, that schema is used, otherwise the schema is inferred from
5605+
`x`. Python value must be convertible to Koda scalar and the result cannot
5606+
be multidimensional DataSlice.
5607+
5608+
Args:
5609+
x: a Python value or a DataItem.
5610+
schema: schema DataItem to set. If `x` is already a DataItem, this will cast
5611+
it to the given schema.
5612+
```
5613+
5614+
### `kd.slices.mask(x)` {#kd.slices.mask}
5615+
Aliases:
5616+
5617+
- [kd.mask](#kd.mask)
5618+
5619+
``` {.no-copy}
5620+
Returns kd.slice(x, kd.MASK).
5621+
```
5622+
55425623
### `kd.slices.ordinal_rank(x, tie_breaker=unspecified, descending=DataItem(False, schema: BOOLEAN), ndim=unspecified)` {#kd.slices.ordinal_rank}
55435624
Aliases:
55445625

@@ -5758,6 +5839,26 @@ Returns:
57585839
The size of `x`.
57595840
```
57605841

5842+
### `kd.slices.slice` {#kd.slices.slice}
5843+
Aliases:
5844+
5845+
- [kd.slice](#kd.slice)
5846+
5847+
- [DataSlice.from_vals](#DataSlice.from_vals)
5848+
5849+
``` {.no-copy}
5850+
Returns a DataSlice created from `x`.
5851+
5852+
If `schema` is set, that schema is used, otherwise the schema is inferred from
5853+
`x`.
5854+
5855+
Args:
5856+
x: a Python value or a DataSlice. If it is a (nested) Python list or tuple,
5857+
a multidimensional DataSlice is created.
5858+
schema: schema DataItem to set. If `x` is already a DataSlice, this will
5859+
cast it to the given schema.
5860+
```
5861+
57615862
### `kd.slices.sort(x, sort_by=unspecified, descending=DataItem(False, schema: BOOLEAN))` {#kd.slices.sort}
57625863
Aliases:
57635864

@@ -5840,6 +5941,15 @@ Returns:
58405941
this will refer to a merged immutable DataBag.
58415942
```
58425943

5944+
### `kd.slices.str(x)` {#kd.slices.str}
5945+
Aliases:
5946+
5947+
- [kd.str](#kd.str)
5948+
5949+
``` {.no-copy}
5950+
Returns kd.slice(x, kd.STRING).
5951+
```
5952+
58435953
### `kd.slices.subslice(x, *slices)` {#kd.slices.subslice}
58445954
Aliases:
58455955

@@ -6867,15 +6977,11 @@ Alias for [kd.functor.bind](#kd.functor.bind) operator.
68676977

68686978
### `kd.bool(x)` {#kd.bool}
68696979

6870-
``` {.no-copy}
6871-
Returns kd.slice(x, kd.BOOLEAN).
6872-
```
6980+
Alias for [kd.slices.bool](#kd.slices.bool) operator.
68736981

68746982
### `kd.bytes(x)` {#kd.bytes}
68756983

6876-
``` {.no-copy}
6877-
Returns kd.slice(x, kd.BYTES).
6878-
```
6984+
Alias for [kd.slices.bytes](#kd.slices.bytes) operator.
68796985

68806986
### `kd.call(fn, *args, return_type_as=DataItem(None, schema: NONE), **kwargs)` {#kd.call}
68816987

@@ -7090,9 +7196,7 @@ Alias for [kd.lists.explode](#kd.lists.explode) operator.
70907196

70917197
### `kd.expr_quote(x)` {#kd.expr_quote}
70927198

7093-
``` {.no-copy}
7094-
Returns kd.slice(x, kd.EXPR).
7095-
```
7199+
Alias for [kd.slices.expr_quote](#kd.slices.expr_quote) operator.
70967200

70977201
### `kd.extract(ds, schema=unspecified)` {#kd.extract}
70987202

@@ -7108,15 +7212,11 @@ Alias for [kd.shapes.flatten](#kd.shapes.flatten) operator.
71087212

71097213
### `kd.float32(x)` {#kd.float32}
71107214

7111-
``` {.no-copy}
7112-
Returns kd.slice(x, kd.FLOAT32).
7113-
```
7215+
Alias for [kd.slices.float32](#kd.slices.float32) operator.
71147216

71157217
### `kd.float64(x)` {#kd.float64}
71167218

7117-
``` {.no-copy}
7118-
Returns kd.slice(x, kd.FLOAT64).
7119-
```
7219+
Alias for [kd.slices.float64](#kd.slices.float64) operator.
71207220

71217221
### `kd.fn(f, *, use_tracing=True, **kwargs)` {#kd.fn}
71227222

@@ -7390,15 +7490,11 @@ Alias for [kd.slices.index](#kd.slices.index) operator.
73907490

73917491
### `kd.int32(x)` {#kd.int32}
73927492

7393-
``` {.no-copy}
7394-
Returns kd.slice(x, kd.INT32).
7395-
```
7493+
Alias for [kd.slices.int32](#kd.slices.int32) operator.
73967494

73977495
### `kd.int64(x)` {#kd.int64}
73987496

7399-
``` {.no-copy}
7400-
Returns kd.slice(x, kd.INT64).
7401-
```
7497+
Alias for [kd.slices.int64](#kd.slices.int64) operator.
74027498

74037499
### `kd.inverse_mapping(x, ndim=unspecified)` {#kd.inverse_mapping}
74047500

@@ -7464,17 +7560,7 @@ Alias for [kd.slices.isin](#kd.slices.isin) operator.
74647560

74657561
### `kd.item` {#kd.item}
74667562

7467-
``` {.no-copy}
7468-
Returns a DataItem created from Python `value`.
7469-
7470-
If `schema` is set, that schema is used, otherwise the schema is inferred from
7471-
`value`. Python value must be convertible to Koda scalar and the result cannot
7472-
be multidimensional DataSlice.
7473-
7474-
Args:
7475-
x: Python value.
7476-
schema: schema DataSlice to set.
7477-
```
7563+
Alias for [kd.slices.item](#kd.slices.item) operator.
74787564

74797565
### `kd.less(x, y)` {#kd.less}
74807566

@@ -7492,16 +7578,13 @@ Creates list(s) by collapsing `items`.
74927578
Returns an immutable list if `db` is not provided.
74937579
74947580
If there is no argument, returns an empty Koda List.
7495-
If the argument is a DataSlice, creates a slice of Koda Lists.
74967581
If the argument is a Python list, creates a nested Koda List.
74977582
74987583
Examples:
74997584
list() -> a single empty Koda List
75007585
list([1, 2, 3]) -> Koda List with items 1, 2, 3
7501-
list(kd.slice([1, 2, 3])) -> (same as above) Koda List with items 1, 2, 3
75027586
list([[1, 2, 3], [4, 5]]) -> nested Koda List [[1, 2, 3], [4, 5]]
7503-
list(kd.slice([[1, 2, 3], [4, 5]]))
7504-
-> 1-D DataSlice with 2 lists [1, 2, 3], [4, 5]
7587+
# items are Koda lists.
75057588
75067589
Args:
75077590
items: The items to use. If not specified, an empty list of OBJECTs will be
@@ -7569,9 +7652,7 @@ Alias for [kd.py.map_py_on_selected](#kd.py.map_py_on_selected) operator.
75697652

75707653
### `kd.mask(x)` {#kd.mask}
75717654

7572-
``` {.no-copy}
7573-
Returns kd.slice(x, kd.MASK).
7574-
```
7655+
Alias for [kd.slices.mask](#kd.slices.mask) operator.
75757656

75767657
### `kd.mask_and(x, y)` {#kd.mask_and}
75777658

@@ -7814,10 +7895,6 @@ Alias for [kd.random.sample_n](#kd.random.sample_n) operator.
78147895

78157896
Alias for [kd.schema.schema_from_py](#kd.schema.schema_from_py) operator.
78167897

7817-
### `kd.schema_from_py_type(tpe)` {#kd.schema_from_py_type}
7818-
7819-
Alias for [kd.schema.schema_from_py_type](#kd.schema.schema_from_py_type) operator.
7820-
78217898
### `kd.select(ds, fltr, expand_filter=DataItem(True, schema: BOOLEAN))` {#kd.select}
78227899

78237900
Alias for [kd.slices.select](#kd.slices.select) operator.
@@ -7913,20 +7990,8 @@ Alias for [kd.core.shallow_clone](#kd.core.shallow_clone) operator.
79137990
Alias for [kd.slices.size](#kd.slices.size) operator.
79147991

79157992
### `kd.slice` {#kd.slice}
7916-
Aliases:
79177993

7918-
- [DataSlice.from_vals](#DataSlice.from_vals)
7919-
7920-
``` {.no-copy}
7921-
Returns a DataSlice created from Python `value`.
7922-
7923-
If `schema` is set, that schema is used, otherwise the schema is inferred from
7924-
`value`.
7925-
7926-
Args:
7927-
x: Python value.
7928-
schema: schema DataSlice to set.
7929-
```
7994+
Alias for [kd.slices.slice](#kd.slices.slice) operator.
79307995

79317996
### `kd.sort(x, sort_by=unspecified, descending=DataItem(False, schema: BOOLEAN))` {#kd.sort}
79327997

@@ -7938,9 +8003,7 @@ Alias for [kd.slices.stack](#kd.slices.stack) operator.
79388003

79398004
### `kd.str(x)` {#kd.str}
79408005

7941-
``` {.no-copy}
7942-
Returns kd.slice(x, kd.STRING).
7943-
```
8006+
Alias for [kd.slices.str](#kd.slices.str) operator.
79448007

79458008
### `kd.stub(x, attrs=DataSlice([], schema: OBJECT, ndims: 1, size: 0))` {#kd.stub}
79468009

@@ -8860,7 +8923,7 @@ Returns a frozen DataSlice equivalent to `self`.
88608923

88618924
### `DataSlice.from_vals` {#DataSlice.from_vals}
88628925

8863-
Alias for [kd.slice](#kd.slice) operator.
8926+
Alias for [kd.slices.slice](#kd.slices.slice) operator.
88648927

88658928
### `DataSlice.get_attr(attr_name, /, default=None)` {#DataSlice.get_attr}
88668929

@@ -9943,16 +10006,13 @@ Returns present iff this DataBag is mutable.
994310006
Creates list(s) by collapsing `items`.
994410007
994510008
If there is no argument, returns an empty Koda List.
9946-
If the argument is a DataSlice, creates a slice of Koda Lists.
994710009
If the argument is a Python list, creates a nested Koda List.
994810010
994910011
Examples:
995010012
list() -> a single empty Koda List
995110013
list([1, 2, 3]) -> Koda List with items 1, 2, 3
9952-
list(kd.slice([1, 2, 3])) -> (same as above) Koda List with items 1, 2, 3
995310014
list([[1, 2, 3], [4, 5]]) -> nested Koda List [[1, 2, 3], [4, 5]]
9954-
list(kd.slice([[1, 2, 3], [4, 5]]))
9955-
-> 1-D DataSlice with 2 lists [1, 2, 3], [4, 5]
10015+
# items are Koda lists.
995610016
995710017
Args:
995810018
items: The items to use. If not specified, an empty list of OBJECTs will be

0 commit comments

Comments
 (0)