{% from "macros.html" import marker, help, result_box %}
{% if not draft %} {# ---------------------------------------------------------------- 1 connect (new) #}

How do you want to start?

{% set mode = form.mode or "url" %}
calling the API…
{{ result_box(result) }} {% else %}
{% set names = draft.streams | list %} {% if step in ("request", "records", "keys", "integrity") and names | length > 1 %} {% elif names %}{% endif %} {% if step == "connect" %} {# ---------------------------------------------------------------- 1 connect (done) #}

Connected: {{ draft.name }}

Base URL {{ draft.source.base_url }} · {{ names | length }} stream(s): {{ names | join(", ") }}

Start over with another input

{% elif step == "auth" %} {# ---------------------------------------------------------------- 2 auth #} {% set auth = draft.source.auth or {} %} {% set kind = auth.type or "none" %}

Authentication

{% if secret_names %}

Secrets held in memory for this draft: {{ secret_names | join(", ") }}

{% endif %}
working…
{% elif step == "request" %} {# ---------------------------------------------------------------- 3 request & pages #} {% set req = stream.request or {} %} {% set pg = stream.paginate or {} %} {% set pkind = pg.type or "none" %}

Request and pagination

{% for p, keys in paginate_fields.items() %}
{% for k in keys %} {% endfor %}
{% endfor %}
Limits
checking the API…
{% elif step == "records" %} {# ---------------------------------------------------------------- 4 records #}

Records

Records land exactly as returned (EL, no transforms).

fetching…
{% elif step == "keys" %} {# ---------------------------------------------------------------- 5 keys & incremental #} {% set inc = stream.incremental %} {% set fields_found = suggest.fields or [] %}

Keys and incremental loading

{% for f in fields_found %}

Reruns never duplicate data: each window replaces itself atomically.

{% elif step == "integrity" %} {# ---------------------------------------------------------------- 6 integrity & PII #} {% set rules = (stream.pii or {}).fields or {} %} {% set found = suggest.pii or {} %} {% set integ = stream.integrity or {} %}

PII

{% set pii_fields = (found.keys() | list) + (rules.keys() | reject("in", found) | list) %} {% if pii_fields %}
{% for f in pii_fields %} {% endfor %}
FieldDetected asAction
{{ f }}{{ found[f] or "rule in spec" }}
{% else %}

No PII found in the preview{% if not suggest.fields %} (run Preview on the Records step first){% endif %}. Detectors still run on every record; detected fields get the project's default action.

{% endif %}

Completeness checks

Did we get everything the API had? Business data-quality rules belong downstream (dbt, etc.).

{% macro chk(integ, name, label, value_key=None, value_default="", step_attr="") %} {% set cfg = integ[name] %}
{% if value_key %}{% endif %}
{% endmacro %} {{ chk(integ, "reconcile_total", "Reconcile with the API's own total") }} {{ chk(integ, "min_records", "At least this many records per window", "value", "1", 'min="0" step="1"') }} {{ chk(integ, "volume_collapse", "Volume above this fraction of recent runs", "min_ratio", "0.2", 'min="0.01" max="1" step="0.01"') }} {{ chk(integ, "max_rejected_ratio", "At most this share of unparseable / keyless records", "value", "0.01", 'min="0" max="1" step="0.01"') }}
{% elif step == "schedule" %} {# ---------------------------------------------------------------- 7 destination & schedule #}

Destination

{% if destination %}

Lake {{ destination.url }} · format {{ destination.format }} · compression {{ destination.compression }}

The destination is shared by the project; change it in Settings.

{% else %}

Saving creates due_project.yaml with a local lake in ./lake; change it later in Settings.

{% endif %}
writing…

Schedule

{% set chosen = draft.schedule %} {% set preset_name = (presets.items() | selectattr("1", "equalto", chosen) | map(attribute="0") | first) if chosen else "none" %}

Alerts are configured for the whole project in Settings.

{% elif step == "review" %} {# ---------------------------------------------------------------- 8 review & save #}

Review and save

working…
{% endif %}
{{ result_box(result) }} {% endif %}