diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 7465b1354..0d0b890ca 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -137,7 +137,7 @@ Datasets -------- You can wrap any layer (include layer set) as a Pytorch dataset. -In this example we will make a dataset out of the followign layer set: +In this example we will make a dataset out of the following layer set: .. doctest:: diff --git a/docs/source/subchunkable_apply_flow_quick_start_guide.rst b/docs/source/subchunkable_apply_flow_quick_start_guide.rst index dbab9e90d..062f0592c 100644 --- a/docs/source/subchunkable_apply_flow_quick_start_guide.rst +++ b/docs/source/subchunkable_apply_flow_quick_start_guide.rst @@ -385,7 +385,7 @@ CUE Files With the builder, a dictionary is all we need to specify a function call. The dictionary can be specified in any structured language, CUE -``zetta_utils`` uses **CUE** files for configuring a run. CUE is an open-source data validation language that is a superset of JSON. +``zetta_utils`` uses **CUE** files for configuring a run. `CUE `_ is an open-source data validation language that is a superset of JSON. To proceed with this tutorial, be sure you have cuelang `installed `_. .. collapse:: Why not just use Python or JSON? diff --git a/zetta_utils/parsing/cue.py b/zetta_utils/parsing/cue.py index ee75ff4f4..f4431f43a 100644 --- a/zetta_utils/parsing/cue.py +++ b/zetta_utils/parsing/cue.py @@ -1,6 +1,7 @@ """cuelang parsing.""" import os import pathlib +import shutil import subprocess import tempfile @@ -24,6 +25,11 @@ def loads(s: str): def load_local(local_path: str): + if shutil.which(cue_exe) is None: # pragma: no cover + raise RuntimeError( + f"{cue_exe} not found. Please ensure cuelang is installed ( https://cuelang.org/ )" + ) + local_path_str = _to_str_path(local_path) command_result = subprocess.run( [cue_exe, "export", local_path_str], capture_output=True, check=False