# Passing two datasets to \`map\_batches\`

**URL:** https://discuss.ray.io/t/passing-two-datasets-to-map-batches/14530
**Category:** Uncategorized
**Created:** [April 26, 2024, 7:43pm UTC](https://discuss.ray.io/t/passing-two-datasets-to-map-batches/14530 "2024-04-26T19:43:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![amigoricardo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/amigoricardo/32/6054_2.png) [@amigoricardo](https://discuss.ray.io/u/amigoricardo)
#### Post date: [April 26, 2024, 7:43pm UTC](https://discuss.ray.io/t/passing-two-datasets-to-map-batches/14530/1 "2024-04-26T19:43:01Z")

</div>

What’s the recommended way of combining data from two datasets in a function using `map_batches`?

Basically, my function would have the following format:  
`def fn(batch1: pd.DataFrame, batch2: pd.DataFrame) -> pd.DataFrame:`

I couldn’t find any reference to this usecase in the docs. Did I miss anything or Ray pipelines aren’t supposed to support that?

Thank you in advance!
