Skip to content

Commit 0f9abf7

Browse files
fix: DFS Arrow example datatypes (#160)
Co-authored-by: Paul Spangler <[email protected]>
1 parent ed1fd57 commit 0f9abf7

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

README.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,20 @@ To install **nisystemlink-clients**, use one of the following methods:
3636

3737
Optional Arrow (pyarrow) Support
3838
--------------------------------
39-
The base install does not pull in ``pyarrow``. Install the optional extra if you
40-
plan to use Arrow RecordBatch ingestion with ``DataFrameClient.append_table_data``::
39+
The base install does not pull in ``pyarrow``. Arrow ``RecordBatch`` ingestion via
40+
``DataFrameClient.append_table_data`` is available starting in
41+
``nisystemlink-clients`` version 2.19.0. Install that version (or newer) with the
42+
optional extra:
4143

42-
$ python -m pip install "nisystemlink-clients[pyarrow]"
44+
$ python -m pip install "nisystemlink-clients[pyarrow]>=2.19.0"
4345

44-
Without the extra, Arrow-specific code paths will raise a ``RuntimeError`` when
45-
attempting to append ``pyarrow.RecordBatch`` instances.
46+
If you already have an older version installed, upgrade with:
47+
48+
$ python -m pip install --upgrade "nisystemlink-clients[pyarrow]>=2.19.0"
49+
50+
Without the extra (or when using a package version earlier than 2.19.0),
51+
Arrow-specific code paths will raise a ``RuntimeError`` when attempting to
52+
append ``pyarrow.RecordBatch`` instances.
4653

4754
.. _usage_section:
4855

examples/dataframe/create_write_data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
# Append via single RecordBatch (Arrow)
4646
batch_single = pa.record_batch(
4747
[
48-
pa.array([6, 7, 8]),
49-
pa.array([0.1, 0.2, 0.3]),
50-
pa.array([datetime.now().isoformat()] * 3),
48+
pa.array([6, 7, 8], type=pa.int32()),
49+
pa.array([0.1, 0.2, 0.3], type=pa.float32()),
50+
pa.array([datetime.now() for _ in range(3)], pa.timestamp("ms")),
5151
],
5252
names=["ix", "Float_Column", "Timestamp_Column"],
5353
)
@@ -57,9 +57,9 @@
5757
batch_list = [
5858
pa.record_batch(
5959
[
60-
pa.array([9, 10]),
61-
pa.array([0.4, 0.5]),
62-
pa.array([datetime.now().isoformat(), datetime.now().isoformat()]),
60+
pa.array([9, 10], type=pa.int32()),
61+
pa.array([0.4, 0.5], type=pa.float32()),
62+
pa.array([datetime.now() for _ in range(2)], pa.timestamp("ms")),
6363
],
6464
names=["ix", "Float_Column", "Timestamp_Column"],
6565
)

0 commit comments

Comments
 (0)