Skip to content

build_dataset_run_record

Public callable

Build a dataset-run metadata record for operational tracking.

Parameters:

Name Type Description Default
None

This callable does not require input parameters.

required

Returns:

Type Description
dict

Structured output produced by this callable.

Source code in src/fabricops_kit/metadata.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def build_dataset_run_record(
    *,
    run_id: str,
    dataset_name: str,
    environment: str,
    source_table: str,
    target_table: str,
    status: str = "started",
    started_at_utc: str | None = None,
    ended_at_utc: str | None = None,
    row_count_source: int | None = None,
    row_count_output: int | None = None,
    notes: str | None = None,
) -> dict:
    """Build a dataset-run metadata record for operational tracking.

        Parameters
        ----------
        None
            This callable does not require input parameters.

        Returns
        -------
        dict
            Structured output produced by this callable.
    """
    return to_jsonable(
        {
            "run_id": run_id,
            "dataset_name": dataset_name,
            "environment": environment,
            "source_table": source_table,
            "target_table": target_table,
            "status": status,
            "started_at_utc": started_at_utc,
            "ended_at_utc": ended_at_utc,
            "row_count_source": row_count_source,
            "row_count_output": row_count_output,
            "notes": notes,
        }
    )