Skip to content

Commit

Permalink
update scripts.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dwreeves committed Jan 9, 2025
1 parent 77ca6c0 commit 99be44f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit 99be44f

Please sign in to comment.