feat: complete catalog-driven preprocessing
Publish documentation / publish (push) Successful in 2m12s
Publish documentation / publish (push) Successful in 2m12s
This commit is contained in:
@@ -4,7 +4,7 @@ from pathlib import Path
|
||||
import typer
|
||||
|
||||
from tht.cli.config_cmd import CONFIG_OPT
|
||||
from tht.cli.schema_cmd import _load_config_or_exit, physical_path
|
||||
from tht.cli.schema_cmd import _load_config_or_exit
|
||||
|
||||
sql_app = typer.Typer(help="Validazione ed esecuzione controllata di SQL (read-only)")
|
||||
|
||||
@@ -17,16 +17,16 @@ def _read_sql(file: Path) -> str:
|
||||
|
||||
|
||||
def _load_physical_or_exit(cfg):
|
||||
from tht.mschema.models import PhysicalSchema
|
||||
from tht.mschema.context import SchemaContextError, load_schema_context
|
||||
|
||||
phys_file = physical_path(cfg)
|
||||
if not phys_file.exists():
|
||||
try:
|
||||
return load_schema_context(cfg).physical
|
||||
except SchemaContextError:
|
||||
typer.secho(
|
||||
f"ERRORE: {phys_file} non trovato. Esegui prima `tht schema introspect`.",
|
||||
"ERRORE: Catalog Metadata Snapshot non disponibile. Esegui il preprocessing.",
|
||||
fg=typer.colors.RED, err=True,
|
||||
)
|
||||
raise typer.Exit(code=1)
|
||||
return PhysicalSchema.from_yaml(phys_file)
|
||||
|
||||
|
||||
def require_action(cfg, action: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user