Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/instructlab/schema/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,15 @@ def _schema_validate(self, text: str, taxonomy: Taxonomy) -> None:
yq_expression = f"{yaml_path} | line"
line = subprocess.check_output(["yq", yq_expression], input=text, text=True)
line = line.strip() if line else 1
except (subprocess.CalledProcessError, FileNotFoundError) as e:
if isinstance(e, FileNotFoundError):
self.yq_available = False
except subprocess.CalledProcessError as e_yq:
logger.warning(
"could not run yq command",
f"Failed to validate file {taxonomy.path}, error: {e_yq}\n"
f"Failed command: yq \"{yq_expression}\" {taxonomy.path}"
)
except FileNotFoundError as e:
self.yq_available = False
logger.warning(
"Missing yq command, could not run yq command",
exc_info=True,
)
if validation_error.validator == "minItems":
Expand Down