Skip to content

Commit

Permalink
add diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson committed Jul 30, 2024
1 parent e10c8bf commit c0b1879
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ PyArrow also supplies two helper functions:

These are zero-copy when possible, but it is not guaranteed. See the [tests](./test/runtests.jl) for some cases of what works and what doesn't work.

The following diagram shows how `PyArrow.table` and `PyArrowTable` fit in:
```mermaid
---
title: Arrow data conversions
---
flowchart TD
arr[Arrow data]
py[Python table]
jl2[Julia table with Julia objects]
jl1[Julia table with python objects]
arr -->|pyarrow.feather.read_feather|py;
arr --> |Arrow.Table|jl2;
py --> |PyArrowTable|jl1;
jl1 --> |PythonCall.pyconvert|jl2;
jl1 --> |PyArrow.table|py;
```

Notes:

* For comparison, Arrow.jl's `Table` is included as `Arrow.Table` in the above diagram.
* `PythonCall.pyconvert` needs to be called on elements of the table, not the entire table (see the `PyArrowTable` docstring for an example).
* `PyArrow.table` can also be used on a "Julia table with Julia objects", but on the python side those objects may appear as wrapped in `juliacall.AnyValue`s. and such

## Examples

Note: see the tests for some more examples, especially with more Julia interop.
Expand Down

0 comments on commit c0b1879

Please sign in to comment.