From 2747c80c189e4a5c9cdf7de853f4967ef3a93ea7 Mon Sep 17 00:00:00 2001 From: Matthew Owen Date: Thu, 21 Mar 2024 12:24:28 -0700 Subject: [PATCH] [Data] [Docs] Adding in missing typing imports (#44216) Adds more imports that were missing in #44203. Example failure here: https://buildkite.com/ray-project/postmerge/builds/3659#018e615b-eeeb-4a7a-8aed-b5cd139eb64b Signed-off-by: Matthew Owen --- ci/pipeline/determine_tests_to_run.py | 1 + doc/source/data/transforming-data.rst | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ci/pipeline/determine_tests_to_run.py b/ci/pipeline/determine_tests_to_run.py index 9fb29895b65d..6232ebe98207 100644 --- a/ci/pipeline/determine_tests_to_run.py +++ b/ci/pipeline/determine_tests_to_run.py @@ -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, diff --git a/doc/source/data/transforming-data.rst b/doc/source/data/transforming-data.rst index cd517d4aeccd..96da176437d4 100644 --- a/doc/source/data/transforming-data.rst +++ b/doc/source/data/transforming-data.rst @@ -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"] @@ -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"] @@ -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]]: