Skip to content

Commit

Permalink
[Data] [Docs] Adding in missing typing imports (ray-project#44216)
Browse files Browse the repository at this point in the history
Adds more imports that were missing in ray-project#44203. Example failure here: https://buildkite.com/ray-project/postmerge/builds/3659#018e615b-eeeb-4a7a-8aed-b5cd139eb64b

Signed-off-by: Matthew Owen <[email protected]>
  • Loading branch information
omatthew98 committed Mar 21, 2024
1 parent e1d7025 commit 2747c80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions ci/pipeline/determine_tests_to_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def get_commit_range():
changed_file.endswith(".py")
or changed_file.endswith(".ipynb")
or changed_file.endswith("BUILD")
or changed_file.endswith(".rst")
):
RAY_CI_DOC_AFFECTED = 1
# Else, this affects only a rst file or so. In that case,
Expand Down
5 changes: 5 additions & 0 deletions doc/source/data/transforming-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ input and output a dictionary with keys of strings and values of any type. For e

.. testcode::

from typing import Any, Dict

def fn(row: Dict[str, Any]) -> Dict[str, Any]:
# access row data
value = row["col1"]
Expand Down Expand Up @@ -95,6 +97,8 @@ dictionaries that have the same type as the input, for example:

.. testcode::

from typing import Any, Dict, List

def fn(row: Dict[str, Any]) -> List[Dict[str, Any]]:
# access row data
value = row["col1"]
Expand Down Expand Up @@ -198,6 +202,7 @@ In this case, your function would look like:

.. testcode::

from typing import Dict, Iterator
import numpy as np

def fn(batch: Dict[str, np.ndarray]) -> Iterator[Dict[str, np.ndarray]]:
Expand Down

0 comments on commit 2747c80

Please sign in to comment.