From 99be44f9dc63a3add3d99c7cc3cc87c1b6ff129e Mon Sep 17 00:00:00 2001 From: Daniel Reeves Date: Wed, 8 Jan 2025 19:56:46 -0500 Subject: [PATCH] update scripts.py --- scripts.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts.py b/scripts.py index b1e3d39..9d4c803 100644 --- a/scripts.py +++ b/scripts.py @@ -3,6 +3,7 @@ and also for manual verification + generation of test case values. """ import json +import os import os.path as op import warnings from typing import NamedTuple @@ -368,7 +369,8 @@ def gen_test_cases(tables: list[str], size: int, seed: int, skip_if_exists: bool @cli.command("gen-hide-macros-yaml") -def gen_hide_args_yaml(): +@click.option("--parse/--no-parse", is_flag=True, default=True) +def gen_hide_args_yaml(parse: bool) -> None: """Generates the YAML that hides the macros from the docs. Requires the `manifest.json` to be available. @@ -378,6 +380,16 @@ def gen_hide_args_yaml(): This is not enforced during CICD, beware! """ + + if parse: + from dbt.cli.main import dbtRunner + os.environ["DO_NOT_TRACK"] = "1" + dbtRunner().invoke( + ["parse"], + profiles_dir=op.join(op.dirname(__file__), "integration_tests", "profiles"), + project_dir=op.dirname(__file__) + ) + exclude_from_hiding = ["ols"] with open("target/manifest.json") as f: manifest = json.load(f)