diff --git a/bazel/python.bzl b/bazel/python.bzl index 9f60dddd47bd..b341512610db 100644 --- a/bazel/python.bzl +++ b/bazel/python.bzl @@ -23,6 +23,7 @@ def doctest(files, gpu = False, name="doctest", deps=[], srcs=[], data=[], args= "--doctest-modules", "--doctest-glob='*.md'", "-c=$(location //bazel:conftest.py)", + "--disable-warnings", "-v" ] + args + ["$(location :%s)" % file for file in files], data = ["//bazel:conftest.py"] + files + data, diff --git a/doc/source/data/key-concepts.rst b/doc/source/data/key-concepts.rst index 66b915777504..5f8e7dd69db5 100644 --- a/doc/source/data/key-concepts.rst +++ b/doc/source/data/key-concepts.rst @@ -161,10 +161,11 @@ or remote filesystems. transformed_ds.write_parquet("/tmp/iris") - print(sorted(os.listdir("/tmp/iris"))) + print(os.listdir("/tmp/iris")) .. testoutput:: - + :options: +MOCK + ['..._000000.parquet', '..._000001.parquet'] diff --git a/python/ray/data/read_api.py b/python/ray/data/read_api.py index dc2d79ae8cf5..3b6c8a81bb4e 100644 --- a/python/ray/data/read_api.py +++ b/python/ray/data/read_api.py @@ -1635,6 +1635,15 @@ def read_sql( For examples of reading from larger databases like MySQL and PostgreSQL, see :ref:`Reading from SQL Databases `. + .. testcode:: + :hide: + + import os + try: + os.remove("example.db") + except OSError: + pass + .. testcode:: import sqlite3 diff --git a/python/ray/train/tensorflow/tensorflow_checkpoint.py b/python/ray/train/tensorflow/tensorflow_checkpoint.py index d561c80b7b94..ecdeed18148c 100644 --- a/python/ray/train/tensorflow/tensorflow_checkpoint.py +++ b/python/ray/train/tensorflow/tensorflow_checkpoint.py @@ -66,14 +66,20 @@ def from_model( A :py:class:`TensorflowCheckpoint` containing the specified model. Examples: + + .. testcode:: - .. testcode:: + from ray.train.tensorflow import TensorflowCheckpoint + import tensorflow as tf - from ray.train.tensorflow import TensorflowCheckpoint - import tensorflow as tf + model = tf.keras.applications.resnet.ResNet101() + checkpoint = TensorflowCheckpoint.from_model(model) + + .. testoutput:: + :options: +MOCK + :hide: - model = tf.keras.applications.resnet.ResNet101() - checkpoint = TensorflowCheckpoint.from_model(model) + ... # Model may or may not be downloaded """ checkpoint = cls.from_dict(