connections
etl_craft.execution.connections ¶
Connection tests run before a pipeline run starts.
run --pipeline_code and run --init-only test the connections the run will use before they
start or resume it. A warehouse failure stops the run before any task starts; email failures
are logged and left to the alert task or SLA hook to report:
- the warehouse, when a task's handler is
SQLorBUSINESS_RULESor cloning is on, and with cloning on, that the warehouse profile'sschema, where cloning writes, exists; - the email relay, when a task's handler is
EMAIL_ALERT, or SLA emails are on and the pipeline has an SLA.
The Engine DB needs no test of its own: finding the pipeline already used it. PYTHON scripts
connect by themselves, so they add nothing. A single-writer warehouse (a DuckDB file) is not
tested: there is no server to be down, and a running task may hold its one writer's lock.
SMTP_TEST_TIMEOUT_SECONDS
module-attribute
¶
How long the email relay test waits for the relay.
WAREHOUSE_HANDLERS
module-attribute
¶
The handlers whose tasks the engine runs against the warehouse.
probe_warehouse ¶
probe_warehouse(config: ConnectorConfig, engine_db: Engine | None = None, *, schema: bool = False) -> str | None
Open the warehouse as a task does and run SELECT 1; return the problem, or None.
With schema, the profile's schema must exist too.
probe_email_relay ¶
Reach the email relay using its TLS mode and send NOOP, or check sendmail.
Returns the problem, or None. It does not log in, so the test never spends an attempt
against a relay that locks accounts out.
check_run_connections ¶
check_run_connections(engine: Engine, config: ConnectorConfig, pipeline_code: str, handlers: set[str], *, sends_sla_email: bool = False) -> None
Test each connection a run of the pipeline uses; ConnectionTestError names failures.