示例#1
0
def cli(
    ctx: click.Context,
    v3_api: bool,
    verbose: bool,
    config_file_location: Optional[str],
    assume_yes: bool,
) -> None:
    """
    Welcome to the great_expectations CLI!

    Most commands follow this format: great_expectations <NOUN> <VERB>

    The nouns are: checkpoint, datasource, docs, init, project, store, suite, validation-operator.
    Most nouns accept the following verbs: new, list, edit
    """
    logger = _set_up_logger()
    if verbose:
        # Note we are explicitly not using a logger in all CLI output to have
        # more control over console UI.
        logger.setLevel(logging.DEBUG)
    ctx.obj = CLIState(v3_api=v3_api,
                       config_file_location=config_file_location,
                       assume_yes=assume_yes)

    if v3_api:
        cli_message("Using v3 (Batch Request) API")
    else:
        cli_message("Using v2 (Batch Kwargs) API")

        ge_config_version: float = (ctx.obj.get_data_context_from_config_file(
        ).get_config().config_version)
        if ge_config_version >= FIRST_GE_CONFIG_VERSION_WITH_CHECKPOINT_STORE:
            raise ge_exceptions.InvalidDataContextConfigError(
                f"Using the legacy v2 (Batch Kwargs) API with a recent config version ({ge_config_version}) is illegal."
            )
示例#2
0
def cli(verbose):
    """
Welcome to the great_expectations CLI!

Most commands follow this format: great_expectations <NOUN> <VERB>

The nouns are: datasource, docs, project, suite

Most nouns accept the following verbs: new, list, edit

In addition, the CLI supports the following special commands:

- great_expectations init : same as `project new`

- great_expectations datasource profile : profile a  datasource

- great_expectations docs build : compile documentation from expectations
"""
    _set_up_logger()
    if verbose:
        # Note we are explicitly not using a logger in all CLI output to have
        # more control over console UI.
        logger.setLevel(logging.DEBUG)
示例#3
0
def cli(ctx, v2_api, verbose, config_file_location):
    """
    Welcome to the great_expectations CLI!

    Most commands follow this format: great_expectations <NOUN> <VERB>

    The nouns are: checkpoint, datasource, docs, init, project, store, suite, validation-operator.
    Most nouns accept the following verbs: new, list, edit
    """
    logger = _set_up_logger()
    if verbose:
        # Note we are explicitly not using a logger in all CLI output to have
        # more control over console UI.
        logger.setLevel(logging.DEBUG)
    ctx.obj = CLIState(v2_api=v2_api,
                       config_file_location=config_file_location)

    if v2_api:
        cli_message("Using v2 (Batch Kwargs) API")
    else:
        cli_message("Using v3 (Batch Request) API")