Edit on GitHub

sqlmesh.cli.options

 1from __future__ import annotations
 2
 3import os
 4
 5import click
 6
 7path = click.option(
 8    "--path",
 9    default=os.getcwd(),
10    help="Path to the models directory.",
11)
12
13config = click.option(
14    "--config",
15    help="Name of the config object. Only applicable to configuration defined using Python script.",
16)
17
18start_time = click.option(
19    "-s",
20    "--start",
21    required=False,
22    help="The start datetime of the interval for which this command will be applied.",
23)
24
25end_time = click.option(
26    "-e",
27    "--end",
28    required=False,
29    help="The end datetime of the interval for which this command will be applied.",
30)
31
32latest_time = click.option(
33    "-l",
34    "--latest",
35    help="The latest time used for non incremental datasets (defaults to now).",
36)
37
38expand = click.option(
39    "--expand",
40    multiple=True,
41    help="Whether or not to expand materialized models (defaults to False). If True, all referenced models are expanded as raw queries. Multiple model names can also be specified, in which case only they will be expanded as raw queries.",
42)
43
44file = click.option(
45    "--file",
46    help="The file to which the dag image should be written.",
47)
48
49match_pattern = click.option(
50    "-k",
51    multiple=True,
52    help="Only run tests that match the pattern of substring.",
53)
54
55verbose = click.option(
56    "-v",
57    "--verbose",
58    is_flag=True,
59    help="Verbose output.",
60)
def path(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def config(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def start_time(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def end_time(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def latest_time(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def expand(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def file(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def match_pattern(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f
def verbose(f: ~FC) -> ~FC:
305    def decorator(f: FC) -> FC:
306        # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
307        option_attrs = attrs.copy()
308        OptionClass = option_attrs.pop("cls", None) or Option
309        _param_memo(f, OptionClass(param_decls, **option_attrs))
310        return f