databricks.labs.dqx.llm.extract_checks_examples
extract_yaml_checks_from_content
def extract_yaml_checks_from_content(content: str,
source_name: str = "content"
) -> list[dict[str, Any]]
Extract all YAML examples from MDX content string.
Arguments:
content
- The MDX content string to extract YAML fromsource_name
- Name of the source for logging purposes (default: "content")
Returns:
List of parsed YAML objects from all valid blocks
extract_yaml_checks_from_mdx
def extract_yaml_checks_from_mdx(mdx_file_path: str) -> list[dict[str, Any]]
Extract all YAML examples from a given MDX file.
Arguments:
mdx_file_path
- Path to the MDX file to extract YAML from
Returns:
List of parsed YAML objects from all valid blocks
Raises:
FileNotFoundError
- If the MDX file does not exist
extract_yaml_checks_examples
def extract_yaml_checks_examples(output_file_path: Path | None = None) -> bool
Extract all YAML examples from both quality_rules.mdx and quality_checks.mdx.
Creates a combined YAML file with all examples from the documentation files in the LLM resources directory for use in language model processing.
Arguments:
output_file_path
- Path to the output file to write the combined YAML content
Returns:
True if extraction was successful, False otherwise