Skip to content

Commit

Permalink
adding in missing imports to code in doc (#44203)
Browse files Browse the repository at this point in the history
#44093 broke one of the data doc tests that was not run on premerge (example here: https://buildkite.com/ray-project/postmerge/builds/3645). This adds missing imports to fix that.

Signed-off-by: Matthew Owen <mowen@anyscale.com>
  • Loading branch information
omatthew98 committed Mar 21, 2024
1 parent 1070c2a commit 73dbeb1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion doc/source/data/transforming-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ pandas DataFrame or a dictionary with string keys and NumPy ndarrays values. For

.. testcode::

def fn(batch: pandas.DataFrame) -> pandas.DataFrame:
import pandas as pd

def fn(batch: pd.DataFrame) -> pd.DataFrame:
# modify batch
batch = ...

Expand All @@ -196,6 +198,8 @@ In this case, your function would look like:

.. testcode::

import numpy as np

def fn(batch: Dict[str, np.ndarray]) -> Iterator[Dict[str, np.ndarray]]:
# yield the same batch multiple times
for _ in range(10):
Expand Down

0 comments on commit 73dbeb1

Please sign in to comment.