JonasJ-ap commented on code in PR #7148:
URL: https://github.com/apache/iceberg/pull/7148#discussion_r1146430838


##########
python/mkdocs/docs/api.md:
##########
@@ -369,3 +369,48 @@ print(
     (datetime.timedelta(seconds=1581),),
 ]
 ```
+
+### Ray
+
+!!! note "Requirements"
+    This requires [Ray to be installed](index.md).
+
+A table scan can also be converted into a Ray dataset:
+
+```python
+ray_dataset = table.scan(
+    row_filter=GreaterThanOrEqual("trip_distance", 10.0),
+    selected_fields=("VendorID", "tpep_pickup_datetime", 
"tpep_dropoff_datetime"),
+).to_ray()
+```
+
+This will return a Ray dataset:
+
+```python
+Dataset(
+    num_blocks=1,
+    num_rows=1168798,
+    schema={
+        VendorID: int64,
+        tpep_pickup_datetime: timestamp[us, tz=UTC],
+        tpep_dropoff_datetime: timestamp[us, tz=UTC]
+    }
+)
+----
+print(
+    ray_dataset.take(2)
+)
+----

Review Comment:
   I was thought of using `----` as a separator. After reconsidering the design 
just now, I changed it to two separated code blocks and added a pointer to Ray 
Dataset API. Sorry for any confusion.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to