From 82cbce6b230ff9042fc970d1586116ebda2470f9 Mon Sep 17 00:00:00 2001 From: clarkzinzow Date: Mon, 25 Sep 2023 10:59:48 -0700 Subject: [PATCH] Allow source code discovery to fail silently for pyo3-defined classes when generating docs. --- daft/__init__.py | 4 ++-- .../datatype_image_mode/daft.ImageMode.from_mode_string.rst | 2 +- docs/source/conf.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daft/__init__.py b/daft/__init__.py index 07edd80585..00b6a8ed4c 100644 --- a/daft/__init__.py +++ b/daft/__init__.py @@ -70,9 +70,9 @@ def get_build_type() -> str: from_pylist, from_ray_dataset, ) -from daft.daft import ImageFormat, ResourceRequest +from daft.daft import ImageFormat, ImageMode, ResourceRequest from daft.dataframe import DataFrame -from daft.datatype import DataType, ImageMode, TimeUnit +from daft.datatype import DataType, TimeUnit from daft.expressions import col, lit from daft.io import from_glob_path, read_csv, read_json, read_parquet from daft.series import Series diff --git a/docs/source/api_docs/datatype_image_mode/daft.ImageMode.from_mode_string.rst b/docs/source/api_docs/datatype_image_mode/daft.ImageMode.from_mode_string.rst index c0b9a4392f..5eb70a21d3 100644 --- a/docs/source/api_docs/datatype_image_mode/daft.ImageMode.from_mode_string.rst +++ b/docs/source/api_docs/datatype_image_mode/daft.ImageMode.from_mode_string.rst @@ -3,4 +3,4 @@ .. currentmodule:: daft -.. automethod:: ImageMode.from_mode_string \ No newline at end of file +.. automethod:: ImageMode.from_mode_string diff --git a/docs/source/conf.py b/docs/source/conf.py index 93b0da049e..b186fcb077 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -112,7 +112,7 @@ def linkcode_resolve(domain, info): try: file = inspect.getsourcefile(obj) lines = inspect.getsourcelines(obj) - except TypeError: + except (TypeError, OSError): # e.g. object is a typing.Union return None path_start = file.find("daft/")