Skip to content

Commit d5624bd

Browse files
committed
docs(remote json): add
1 parent 4e9ce4e commit d5624bd

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88
## [Development]
99
### Docs
1010

11-
* Update Python remote mode notebook: Fixed engine results
11+
* Python remote mode notebook: Fixed engine results
12+
* Python remote mode: Add JSON example
1213

1314
## [0.35.1 - 2024-12-11]
1415

docs/source/gfql/remote.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,19 @@ Run Python on an existing graph, return a table
192192
193193
assert len(some_edges_df) == 10
194194
195+
196+
Run Python on an existing graph, return JSON
197+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198+
199+
.. code-block:: python
200+
201+
import graphistry
202+
203+
g = graphistry.bind(dataset_id='ds-abc-123')
204+
205+
def first_n_edges_shape(g):
206+
return {'num_edges': len(g._edges[:10])}
207+
208+
obj = g.remote_python_json(first_n_edges_shape)
209+
210+
assert obj['num_edges'] == 10

0 commit comments

Comments
 (0)