Replies: 1 comment 1 reply
-
I believe the issue is returning a daft DataFrame from the Something like, @ray.remote
def create_mock_arrow_data():
daft.context.set_runner_ray(address=RAY_ADDRESS, noop_if_initialized=True)
try:
batch_data = {
"pulocationid": pa.array([100, 101, 102, 103, 104, 105, 106, 107, 108, 109]),
"dolocationid": pa.array([200, 201, 202, 203, 204, 205, 206, 207, 208, 209]),
"passenger_count": pa.array([1, 2, 3, 1, 2, 4, 1, 1, 2, 3]),
"trip_distance": pa.array([1.5, 2.3, 3.1, 4.7, 1.2, 2.8, 3.5, 4.2, 5.1, 1.8]),
"fare_amount": pa.array([10.5, 15.3, 21.5, 25.0, 8.75, 16.5, 22.0, 28.5, 32.0, 12.5]),
"tip_amount": pa.array([2.5, 3.0, 4.5, 5.0, 1.5, 3.5, 4.0, 6.0, 7.0, 2.0]),
}
batch = pa.RecordBatch.from_pydict(batch_data)
table = pa.Table.from_batches([batch])
arrow_ref = ray.put(table)
return ray.data.from_arrow_refs([arrow_ref])
def get_mock_taxi_data() -> daft.DataFrame:
daft.context.set_runner_ray(address=RAY_ADDRESS, noop_if_initialized=True)
ray_dataset = ray.get(create_mock_arrow_data.remote())
return daft.from_ray_dataset(ray_dataset)
daft_df = get_mock_taxi_data() Please let me know if these adjustments work. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is a minimal example:
The exception is:
Any idea how I can fix this?
Beta Was this translation helpful? Give feedback.
All reactions