Skip to content

Commit 80e3111

Browse files
committed
fixes
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 88758f3 commit 80e3111

9 files changed

Lines changed: 20 additions & 2 deletions

File tree

docs/api/python/arrays.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Pluggable Encodings
128128
-------------------
129129

130130
Subclasses of :class:`~vortex.PyArray` can be used to implement custom Vortex encodings in Python. These encodings
131-
can be registered with the :attr:`~vortex.registry` so they are available to use when reading Vortex files.
131+
can be registered with :func:`vortex.registry.register` so they are available to use when reading Vortex files.
132132

133133
.. autoclass:: vortex.PyArray
134134
:members:

docs/api/python/expr.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ the following expression represents the set of rows for which the `age` column l
5151
>>> import vortex as vx
5252
>>> import vortex.expr as ve
5353
>>> import pyarrow as pa
54+
>>>
5455
>>> array = pa.array([
5556
... {"x": 1, "y": {"yy": "a"}},
5657
... {"x": 2, "y": {"yy": "b"}},
5758
... ])
59+
>>>
5860
>>> vx.io.write(vx.array(array), '/tmp/foo.vortex')
5961
>>> (vx.file.open('/tmp/foo.vortex')
6062
... .scan(expr=vx.expr.column("y")["yy"] == "a")

docs/api/python/registry.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Registry
44
The Python registry module registers Python extension types with the process-wide Vortex registry.
55

66
.. automodule:: vortex.registry
7-
:members:
7+
8+
.. autofunction:: vortex.registry.register

docs/getting-started/python.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Use :func:`~vortex.io.write` to write the Vortex array to disk:
3636
.. doctest::
3737

3838
>>> import vortex as vx
39+
>>>
3940
>>> vx.io.write(vtx, "example.vortex") # doctest: +SKIP
4041

4142
Small Vortex files (this one is just 71KiB) currently have substantial overhead relative to their
@@ -56,6 +57,7 @@ Use :func:`~vortex.open` to open and read the Vortex array from disk:
5657
.. doctest::
5758

5859
>>> import vortex as vx
60+
>>>
5961
>>> cvtx = vx.open("example.vortex").scan().read_all() # doctest: +SKIP
6062

6163

@@ -68,6 +70,7 @@ IO and decoding and read just the data that is relevant to you:
6870
.. doctest::
6971

7072
>>> import vortex as vx
73+
>>>
7174
>>> vf = vx.open("example.vortex") # doctest: +SKIP
7275
>>> # row indices must be ordered and unique
7376
>>> indices = vx.array([1, 2, 10])

docs/user-guide/pandas.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ convert:
1010
```{doctest} pycon
1111
>>> import vortex as vx
1212
>>> import pyarrow.parquet as pq
13+
>>>
1314
>>> vx.io.write(pq.read_table("_static/example.parquet"), 'example.vortex')
15+
>>>
1416
>>> f = vx.open('example.vortex')
1517
>>> df = f.scan().read_all().to_pandas()
1618
>>> df[['tip_amount', 'fare_amount']].head(3)
@@ -47,6 +49,7 @@ convert:
4749

4850
```{doctest} pycon
4951
>>> import pandas as pd
52+
>>>
5053
>>> df = pd.DataFrame({'age': [25, 31, 33, 57], 'name': ['Joseph', 'Narendra', 'Angela', 'Mikhail']})
5154
>>> vx.array(df).to_arrow_table()
5255
pyarrow.Table

docs/user-guide/polars.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Vortex integrates with Polars via {meth}`.VortexFile.to_polars`, which returns a
1313
```{doctest} pycon
1414
>>> import vortex as vx
1515
>>> import pyarrow.parquet as pq
16+
>>>
1617
>>> vx.io.write(pq.read_table("_static/example.parquet"), 'example.vortex')
18+
>>>
1719
>>> lf = vx.open('example.vortex').to_polars()
1820
>>> lf = lf.select('tip_amount', 'fare_amount')
1921
>>> lf = lf.head(3)

docs/user-guide/pyarrow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ anything that implements `IntoArrayIterator`, including {class}`pyarrow.Table` a
1212
```{doctest} pycon
1313
>>> import pyarrow.parquet as pq
1414
>>> import vortex as vx
15+
>>>
1516
>>> table = pq.read_table("_static/example.parquet")
1617
>>> vx.io.write(table, 'example.vortex')
1718
```
@@ -65,6 +66,7 @@ The {func}`~vortex.array` function constructs a Vortex array from an Arrow array
6566

6667
```{doctest} pycon
6768
>>> import pyarrow as pa
69+
>>>
6870
>>> arrow = pa.array([1, 2, None, 3])
6971
>>> arr = vx.array(arrow)
7072
>>> arr.dtype

docs/user-guide/ray.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ and then run `make -C docs doctest` -->
99
>>> import vortex as vx
1010
>>> import pyarrow.parquet as pq
1111
>>> import os
12+
>>>
1213
>>> os.makedirs("ray_data", exist_ok=True)
1314
>>> table = pq.read_table("_static/example.parquet")
15+
>>>
1416
>>> vx.io.write(table, 'ray_data/example-01.vortex')
1517
>>> vx.io.write(table, 'ray_data/example-02.vortex')
1618
>>> vx.io.write(table, 'ray_data/example-03.vortex')

docs/user-guide/vortex-python.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ applied directly:
123123

124124
```{doctest} pycon
125125
>>> import vortex.expr as ve
126+
>>>
126127
>>> arr = vx.array([
127128
... {'name': 'Alice', 'age': 30},
128129
... {'name': 'Bob', 'age': 25},
@@ -139,7 +140,9 @@ applied directly:
139140

140141
```{doctest} pycon
141142
>>> import pyarrow.parquet as pq
143+
>>>
142144
>>> vx.io.write(pq.read_table("_static/example.parquet"), 'example.vortex')
145+
>>>
143146
>>> f = vx.open('example.vortex')
144147
>>> len(f)
145148
1000

0 commit comments

Comments
 (0)