{
  "metadata": {
    "dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json",
    "dbt_version": "1.12.4",
    "generated_at": "2026-10-15T17:01:16.296287Z",
    "invocation_id": "9e454255-e0f0-46a7-9a94-b9ea53e90861",
    "invocation_started_at": "2026-10-15T17:01:03.893831Z",
    "env": {}
  },
  "results": [
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:06.748250Z",
          "completed_at": "2026-10-15T17:01:06.768250Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:06.770250Z",
          "completed_at": "2026-10-15T17:01:06.970295Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.23004579544067383,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.stg_crime_details",
      "compiled": true,
      "compiled_code": "select\n    record_id,\n    time,\n    victim,\n    narrative,\n    date_raw,\n    source_page,\n    notes\n\nfrom read_parquet('../db/crime_details.parquet')",
      "relation_name": "\"opcrime_dbt\".\"main\".\"stg_crime_details\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:06.761250Z",
          "completed_at": "2026-10-15T17:01:06.787250Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:06.819250Z",
          "completed_at": "2026-10-15T17:01:06.976295Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.23804569244384766,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.stg_geocode_cache",
      "compiled": true,
      "compiled_code": "-- json_each unpivots the single wide object; read_json_auto would infer 7350 columns\nwith raw as (\n\n    select content::JSON as payload\n    from read_text('../cache/location_cache.json')\n\n)\n\nselect\n    entry.key                              as location_key,\n    try_cast(entry.value ->> 0 as double)  as lat,\n    try_cast(entry.value ->> 1 as double)  as long,\n    (entry.value ->> 0) is null            as known_unresolvable\n\nfrom raw, json_each(raw.payload) as entry",
      "relation_name": "\"opcrime_dbt\".\"main\".\"stg_geocode_cache\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:06.758250Z",
          "completed_at": "2026-10-15T17:01:06.769250Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:06.814250Z",
          "completed_at": "2026-10-15T17:01:06.978295Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.24004554748535156,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.stg_crimes",
      "compiled": true,
      "compiled_code": "select\n    record_id,\n    complaint_num,\n    join_key,\n    source,\n    pdf_filename,\n    pdf_url,\n    block_position,\n    date,\n    offense,\n    pdf_offense_text,\n    primary_nibrs_code,\n    primary_crime_against,\n    primary_offense_type,\n    nibrs_codes,\n    crime_against_groups,\n    offense_types,\n    offense_descriptions,\n    charge_count,\n    location,\n    lat,\n    long,\n    loc,\n    zone_id,\n    zone_name,\n    pd_zone,\n    pd_post,\n    incident_id_raw,\n    occur_datetime,\n    date_mismatch,\n    merge_notes,\n    lower(trim(location)) as location_key_naive\n\nfrom read_parquet('../db/crimes.parquet')",
      "relation_name": "\"opcrime_dbt\".\"main\".\"stg_crimes\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:06.765250Z",
          "completed_at": "2026-10-15T17:01:06.819250Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:06.824250Z",
          "completed_at": "2026-10-15T17:01:06.981295Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.24004578590393066,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.stg_policing_zones",
      "compiled": true,
      "compiled_code": "select\n    zone       as zone_id,\n    name       as zone_name,\n    geom       as zone_geom\n\nfrom ST_Read('../Policing_Zones_Data/policing_zones_2024.geojson')",
      "relation_name": "\"opcrime_dbt\".\"main\".\"stg_policing_zones\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.005295Z",
          "completed_at": "2026-10-15T17:01:07.057295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.060295Z",
          "completed_at": "2026-10-15T17:01:07.122295Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.13100004196166992,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_stg_crime_details_record_id.911c0d525b",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"stg_crime_details\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.027295Z",
          "completed_at": "2026-10-15T17:01:07.059296Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.086295Z",
          "completed_at": "2026-10-15T17:01:07.127297Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.13500022888183594,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_stg_crime_details_record_id.c429c74320",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"stg_crime_details\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.040295Z",
          "completed_at": "2026-10-15T17:01:07.086295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.090295Z",
          "completed_at": "2026-10-15T17:01:07.133295Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.13899993896484375,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_stg_geocode_cache_location_key.491454ab94",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect location_key\nfrom \"opcrime_dbt\".\"main\".\"stg_geocode_cache\"\nwhere location_key is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.148295Z",
          "completed_at": "2026-10-15T17:01:07.172295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.191295Z",
          "completed_at": "2026-10-15T17:01:07.225295Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.08599972724914551,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_stg_crimes_record_id.51e037eb79",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.161295Z",
          "completed_at": "2026-10-15T17:01:07.194295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.195295Z",
          "completed_at": "2026-10-15T17:01:07.232295Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.09400010108947754,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_stg_crimes_record_id.f888974518",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.177295Z",
          "completed_at": "2026-10-15T17:01:07.200295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.202295Z",
          "completed_at": "2026-10-15T17:01:07.239295Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.08499979972839355,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_stg_policing_zones_zone_id.b5e906a3c4",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect zone_id\nfrom \"opcrime_dbt\".\"main\".\"stg_policing_zones\"\nwhere zone_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.250296Z",
          "completed_at": "2026-10-15T17:01:07.264295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.267296Z",
          "completed_at": "2026-10-15T17:01:07.397846Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.15755033493041992,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_stg_policing_zones_zone_name.91a756e3ea",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect zone_name\nfrom \"opcrime_dbt\".\"main\".\"stg_policing_zones\"\nwhere zone_name is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.270295Z",
          "completed_at": "2026-10-15T17:01:07.292328Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.293838Z",
          "completed_at": "2026-10-15T17:01:07.408846Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.15255069732666016,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_stg_policing_zones_zone_id.6b6aff4afd",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    zone_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"stg_policing_zones\"\nwhere zone_id is not null\ngroup by zone_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.287320Z",
          "completed_at": "2026-10-15T17:01:07.296846Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.298846Z",
          "completed_at": "2026-10-15T17:01:07.644894Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.3805985450744629,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.crime_details",
      "compiled": true,
      "compiled_code": "select *\nfrom \"opcrime_dbt\".\"main\".\"stg_crime_details\"",
      "relation_name": "\"opcrime_dbt\".\"main\".\"crime_details\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.440846Z",
          "completed_at": "2026-10-15T17:01:07.449846Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.452846Z",
          "completed_at": "2026-10-15T17:01:07.648894Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.21704816818237305,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.dim_date",
      "compiled": true,
      "compiled_code": "-- Spine excludes the 1900-01-01 parse-failure sentinel so the calendar covers\n-- only real reporting history.\nwith bounds as (\n\n    select\n        min(date) as first_date,\n        max(date) as last_date\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\"\n    where date > '1901-01-01'\n\n), spine as (\n\n    select unnest(generate_series(first_date, last_date, interval 1 day)) as date_day\n    from bounds\n\n)\n\nselect\n    cast(date_day as date)          as date_day,\n    year(date_day)                  as year,\n    month(date_day)                 as month,\n    day(date_day)                   as day,\n    quarter(date_day)               as quarter,\n    week(date_day)                  as week,\n    dayofweek(date_day)             as day_of_week,\n    dayname(date_day)               as day_name,\n    monthname(date_day)             as month_name,\n    dayofweek(date_day) in (0, 6)   as is_weekend,\n    strftime(date_day, '%Y-%m')     as year_month,\n    strftime(date_day, '%Y-%m-%d')  as date_str\n\nfrom spine",
      "relation_name": "\"opcrime_dbt\".\"main\".\"dim_date\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.669894Z",
          "completed_at": "2026-10-15T17:01:07.679894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.682894Z",
          "completed_at": "2026-10-15T17:01:07.751894Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.09199953079223633,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.int_complaint_quality",
      "compiled": true,
      "compiled_code": "-- One row per complaint number, classifying why it repeats. The two problem\n-- classes have different owners: republication is an ingest bug, collision is a\n-- source data issue we flag rather than repair.\nwith grouped as (\n\n    select\n        complaint_num,\n        count(*)                       as row_count,\n        count(distinct date)           as distinct_dates,\n        count(distinct offense)        as distinct_offenses,\n        count(distinct location)       as distinct_locations,\n        count(distinct pdf_filename)   as distinct_pdfs\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\"\n    where complaint_num is not null\n    group by complaint_num\n\n)\n\nselect\n    *,\n    case\n        when row_count = 1 then 'unique'\n        when distinct_dates > 1\n          or distinct_offenses > 1\n          or distinct_locations > 1 then 'collision'\n        when distinct_pdfs > 1 then 'republished'\n        else 'other_duplicate'\n    end as quality_class\n\nfrom grouped",
      "relation_name": "\"opcrime_dbt\".\"main\".\"int_complaint_quality\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.778894Z",
          "completed_at": "2026-10-15T17:01:07.790894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.792894Z",
          "completed_at": "2026-10-15T17:01:07.887894Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.11600017547607422,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.int_crimes_zoned",
      "compiled": true,
      "compiled_code": "-- Ports prepare_crime_db.py assign_zones(), including its nearest-zone snap.\n-- The snap is a real business rule, not an implementation detail: edge-street\n-- geocodes on Harlem, Austin and North Ave land just outside the village polygon\n-- and would otherwise be dropped. Omitting it moves 1627 rows.\nwith pts as (\n\n    select\n        record_id,\n        lat,\n        long,\n        case when lat is not null then ST_Point(long, lat) end as pt\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\"\n\n), candidates as (\n\n    select\n        p.record_id,\n        z.zone_id,\n        z.zone_name,\n        ST_Contains(z.zone_geom, p.pt) as contained,\n        ST_Distance(p.pt, z.zone_geom) as dist\n    from pts as p\n    cross join \"opcrime_dbt\".\"main\".\"stg_policing_zones\" as z\n    where p.pt is not null\n\n), best as (\n\n    select\n        record_id,\n        zone_id,\n        zone_name,\n        contained,\n        dist,\n        count(*) filter (where contained) over (partition by record_id) as contain_count\n    from candidates\n    qualify row_number() over (\n        partition by record_id\n        order by contained desc, dist asc, zone_id asc\n    ) = 1\n\n)\n\nselect\n    p.record_id,\n    p.lat,\n    p.long,\n    case when b.contained or b.dist < 0.0005 then b.zone_id   end as zone_id,\n    case when b.contained or b.dist < 0.0005 then b.zone_name end as zone_name,\n    coalesce(b.contain_count, 0) > 1 as zone_boundary_ambiguous,\n    case\n        when p.lat is null                                   then 'ungeocoded'\n        when b.contained                                     then 'in_village'\n        when b.dist < 0.0005   then 'snapped'\n        else 'outside_village'\n    end as zone_status\n\nfrom pts as p\nleft join best as b using (record_id)",
      "relation_name": "\"opcrime_dbt\".\"main\".\"int_crimes_zoned\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.415846Z",
          "completed_at": "2026-10-15T17:01:07.422846Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.424846Z",
          "completed_at": "2026-10-15T17:01:07.891894Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.48404788970947266,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.crimes",
      "compiled": true,
      "compiled_code": "select\n    *,\n    year(date)                 as year,\n    month(date)                as month,\n    day(date)                  as day,\n    strftime(date, '%Y-%m-%d') as date_str\n\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\"",
      "relation_name": "\"opcrime_dbt\".\"main\".\"crimes\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.665894Z",
          "completed_at": "2026-10-15T17:01:07.673894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.674894Z",
          "completed_at": "2026-10-15T17:01:07.897894Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.2390000820159912,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.dim_offense",
      "compiled": true,
      "compiled_code": "select\n    offense                       as offense_text,\n    max(primary_nibrs_code)       as primary_nibrs_code,\n    max(primary_crime_against)    as primary_crime_against,\n    max(primary_offense_type)     as primary_offense_type,\n    count(*)                      as incident_count,\n    min(date)                     as first_seen,\n    max(date)                     as last_seen\n\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\"\nwhere offense is not null\ngroup by offense",
      "relation_name": "\"opcrime_dbt\".\"main\".\"dim_offense\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.914894Z",
          "completed_at": "2026-10-15T17:01:07.934894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.937894Z",
          "completed_at": "2026-10-15T17:01:07.976894Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.0709996223449707,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_crime_details_record_id.b499c537d6",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"crime_details\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.926894Z",
          "completed_at": "2026-10-15T17:01:07.948894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.949894Z",
          "completed_at": "2026-10-15T17:01:07.985894Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.08099985122680664,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_crime_details_record_id.b4910cf80a",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"crime_details\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.939894Z",
          "completed_at": "2026-10-15T17:01:07.953894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.956894Z",
          "completed_at": "2026-10-15T17:01:07.988894Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.0709998607635498,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_dim_date_date_day.e3f312efb2",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect date_day\nfrom \"opcrime_dbt\".\"main\".\"dim_date\"\nwhere date_day is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.003894Z",
          "completed_at": "2026-10-15T17:01:08.017894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.020894Z",
          "completed_at": "2026-10-15T17:01:08.096894Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.10502338409423828,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_dim_date_date_day.d56fd19199",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    date_day as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"dim_date\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.062894Z",
          "completed_at": "2026-10-15T17:01:08.076894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.080894Z",
          "completed_at": "2026-10-15T17:01:08.120940Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.10804629325866699,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_int_complaint_quality_complaint_num.36ac3a3ea8",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect complaint_num\nfrom \"opcrime_dbt\".\"main\".\"int_complaint_quality\"\nwhere complaint_num is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.022894Z",
          "completed_at": "2026-10-15T17:01:08.074894Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.077894Z",
          "completed_at": "2026-10-15T17:01:08.183940Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.17304539680480957,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_int_complaint_quality_quality_class__unique__republished__collision__other_duplicate.d2708c49e9",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        quality_class as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"int_complaint_quality\"\n    group by quality_class\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'unique','republished','collision','other_duplicate'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.110940Z",
          "completed_at": "2026-10-15T17:01:08.123940Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.125940Z",
          "completed_at": "2026-10-15T17:01:08.190940Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.08899974822998047,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_int_complaint_quality_row_count.83078b64a2",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect row_count\nfrom \"opcrime_dbt\".\"main\".\"int_complaint_quality\"\nwhere row_count is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.146940Z",
          "completed_at": "2026-10-15T17:01:08.177940Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.178940Z",
          "completed_at": "2026-10-15T17:01:08.221940Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.12000036239624023,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_int_complaint_quality_complaint_num.6421025a1d",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    complaint_num as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"int_complaint_quality\"\nwhere complaint_num is not null\ngroup by complaint_num\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.223940Z",
          "completed_at": "2026-10-15T17:01:08.260940Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.262940Z",
          "completed_at": "2026-10-15T17:01:08.495987Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.2800467014312744,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_int_crimes_zoned_zone_status__in_village__snapped__outside_village__ungeocoded.fe63c9b33d",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        zone_status as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"\n    group by zone_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'in_village','snapped','outside_village','ungeocoded'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.205940Z",
          "completed_at": "2026-10-15T17:01:08.222940Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.255940Z",
          "completed_at": "2026-10-15T17:01:08.544987Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.34804677963256836,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_int_crimes_zoned_zone_id__1__2__3__4__5__6__7__8.c8ebed71ea",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        zone_id as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"\n    group by zone_id\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    '1','2','3','4','5','6','7','8'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.277940Z",
          "completed_at": "2026-10-15T17:01:08.285940Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.287940Z",
          "completed_at": "2026-10-15T17:01:08.593988Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.3260483741760254,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.assert_zone_assignment_parity",
      "compiled": true,
      "compiled_code": "-- The SQL zone assignment must match the Python it reimplements.\n--\n-- assign_zones() in prepare_crime_db.py and int_crimes_zoned compute the same\n-- thing two ways. This fails if they disagree on any incident that is not sitting\n-- on a shared polygon boundary, where both answers are legitimate and the tie-break\n-- differs by design.\n--\n-- This is the test that would catch someone tuning SNAP_TOL in the Python without\n-- updating zone_snap_tolerance_deg in dbt_project.yml. That exact mismatch already\n-- happened once during development: a naive ST_Within with no tolerance moved 1,627\n-- incidents and took agreement down to 92.77 percent. Nothing was checking, so it\n-- was found by hand. Now something checks.\n\nselect\n    p.record_id,\n    p.zone_id as pipeline_zone_id,\n    d.zone_id as dbt_zone_id,\n    d.zone_status,\n    p.lat,\n    p.long\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\" as p\njoin \"opcrime_dbt\".\"main\".\"int_crimes_zoned\" as d using (record_id)\nwhere p.zone_id is distinct from d.zone_id\n  and not d.zone_boundary_ambiguous",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.559987Z",
          "completed_at": "2026-10-15T17:01:08.588989Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.589989Z",
          "completed_at": "2026-10-15T17:01:08.647987Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.09400010108947754,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_int_crimes_zoned_zone_status.49f000ec3b",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect zone_status\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"\nwhere zone_status is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "no-op",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.656987Z",
          "completed_at": "2026-10-15T17:01:08.656987Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.657987Z",
          "completed_at": "2026-10-15T17:01:08.657987Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.0029997825622558594,
      "adapter_response": {},
      "message": "NO-OP",
      "failures": 0,
      "unique_id": "exposure.opcrime.oak_park_crime_dashboard",
      "compiled": null,
      "compiled_code": null,
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "no-op",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.666519Z",
          "completed_at": "2026-10-15T17:01:08.666519Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.667519Z",
          "completed_at": "2026-10-15T17:01:08.667519Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.003011941909790039,
      "adapter_response": {},
      "message": "NO-OP",
      "failures": 0,
      "unique_id": "exposure.opcrime.oak_park_crime_map",
      "compiled": null,
      "compiled_code": null,
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "no-op",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.675519Z",
          "completed_at": "2026-10-15T17:01:08.675519Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.676519Z",
          "completed_at": "2026-10-15T17:01:08.676519Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.0029997825622558594,
      "adapter_response": {},
      "message": "NO-OP",
      "failures": 0,
      "unique_id": "exposure.opcrime.weekly_crime_email",
      "compiled": null,
      "compiled_code": null,
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.529987Z",
          "completed_at": "2026-10-15T17:01:08.542987Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.545987Z",
          "completed_at": "2026-10-15T17:01:08.747524Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.22353315353393555,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_int_crimes_zoned_record_id.f8a6d8525b",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.685519Z",
          "completed_at": "2026-10-15T17:01:08.741523Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.742524Z",
          "completed_at": "2026-10-15T17:01:08.790523Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.11900520324707031,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_crimes_primary_crime_against__Person__Property__Society.bd32653430",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        primary_crime_against as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"crimes\"\n    group by primary_crime_against\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'Person','Property','Society'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.609987Z",
          "completed_at": "2026-10-15T17:01:08.627987Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.629987Z",
          "completed_at": "2026-10-15T17:01:08.796523Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.19453668594360352,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_int_crimes_zoned_record_id.7e05a5b868",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.760520Z",
          "completed_at": "2026-10-15T17:01:08.791520Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.792521Z",
          "completed_at": "2026-10-15T17:01:08.835520Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.08800125122070312,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_crimes_source__pdf__dashboard__both.677aa5beb0",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        source as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"crimes\"\n    group by source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'pdf','dashboard','both'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.855522Z",
          "completed_at": "2026-10-15T17:01:08.898520Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.901521Z",
          "completed_at": "2026-10-15T17:01:08.937523Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.08600139617919922,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.dbt_utils_unique_combination_of_columns_crimes_pdf_filename__block_position.00888532bf",
      "compiled": true,
      "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n    select\n        pdf_filename, block_position\n    from (select * from \"opcrime_dbt\".\"main\".\"crimes\" where pdf_filename is not null) dbt_subquery\n    group by pdf_filename, block_position\n    having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.945522Z",
          "completed_at": "2026-10-15T17:01:08.960519Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.961520Z",
          "completed_at": "2026-10-15T17:01:08.980523Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.03900146484375,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_crimes_date.31173fcec1",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect date\nfrom \"opcrime_dbt\".\"main\".\"crimes\"\nwhere date is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.989523Z",
          "completed_at": "2026-10-15T17:01:09.003521Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.004528Z",
          "completed_at": "2026-10-15T17:01:09.042521Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.05699944496154785,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_crimes_record_id.d23baaa57d",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"crimes\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.051521Z",
          "completed_at": "2026-10-15T17:01:09.078520Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.081520Z",
          "completed_at": "2026-10-15T17:01:09.114547Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.07102489471435547,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.relationships_crime_details_record_id__record_id__ref_crimes_.125285382f",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith child as (\n    select record_id as from_field\n    from \"opcrime_dbt\".\"main\".\"crime_details\"\n    where record_id is not null\n),\n\nparent as (\n    select record_id as to_field\n    from \"opcrime_dbt\".\"main\".\"crimes\"\n)\n\nselect\n    from_field\n\nfrom child\nleft join parent\n    on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "warn",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.815522Z",
          "completed_at": "2026-10-15T17:01:08.823519Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.836519Z",
          "completed_at": "2026-10-15T17:01:09.123550Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.3180274963378906,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "Got 34 results, configured to warn if != 0",
      "failures": 34,
      "unique_id": "test.opcrime.assert_no_complaint_collisions",
      "compiled": true,
      "compiled_code": "\n\n-- One complaint number on materially different incidents. A source data problem,\n-- so it is flagged rather than repaired per feedback_flag_dont_fix. Currently 25 groups.\n\nselect\n    complaint_num,\n    count(*)                  as row_count,\n    count(distinct date)      as distinct_dates,\n    count(distinct offense)   as distinct_offenses,\n    count(distinct location)  as distinct_locations\n\nfrom \"opcrime_dbt\".\"main\".\"crimes\"\nwhere complaint_num is not null\ngroup by complaint_num\nhaving count(*) > 1\n   and (count(distinct date) > 1\n        or count(distinct offense) > 1\n        or count(distinct location) > 1)",
      "relation_name": "\"opcrime_dbt\".\"main_dbt_test__audit\".\"assert_no_complaint_collisions\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "warn",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:08.819522Z",
          "completed_at": "2026-10-15T17:01:08.840519Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:08.842524Z",
          "completed_at": "2026-10-15T17:01:09.131550Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.3240227699279785,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "Got 68 results, configured to warn if != 0",
      "failures": 68,
      "unique_id": "test.opcrime.assert_no_republished_pdf_duplicates",
      "compiled": true,
      "compiled_code": "\n\n-- Same incident ingested twice because OPPD republished the report under a new\n-- filename (-v2 against -v3, or an -02 suffix). Currently 45 groups, 48 rows\n-- double counted downstream. Flagged not fixed: the repair belongs in\n-- drop_exact_source_duplicates. See dbt_writeup.md.\n\nselect\n    complaint_num,\n    count(*)                                 as row_count,\n    string_agg(distinct pdf_filename, ' | ') as filenames\n\nfrom \"opcrime_dbt\".\"main\".\"crimes\"\nwhere complaint_num is not null\ngroup by complaint_num\nhaving count(*) > 1\n   and count(distinct date) = 1\n   and count(distinct offense) = 1\n   and count(distinct location) = 1\n   and count(distinct pdf_filename) > 1",
      "relation_name": "\"opcrime_dbt\".\"main_dbt_test__audit\".\"assert_no_republished_pdf_duplicates\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.138547Z",
          "completed_at": "2026-10-15T17:01:09.151548Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.153549Z",
          "completed_at": "2026-10-15T17:01:09.195550Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.0670003890991211,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_dim_offense_offense_text.c23a395de2",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect offense_text\nfrom \"opcrime_dbt\".\"main\".\"dim_offense\"\nwhere offense_text is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.156546Z",
          "completed_at": "2026-10-15T17:01:09.171549Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.173550Z",
          "completed_at": "2026-10-15T17:01:09.206546Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.06400227546691895,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_dim_offense_offense_text.ef88688bb9",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    offense_text as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"dim_offense\"\nwhere offense_text is not null\ngroup by offense_text\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.168549Z",
          "completed_at": "2026-10-15T17:01:09.177547Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.178548Z",
          "completed_at": "2026-10-15T17:01:09.268547Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.10400390625,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.int_crimes_deduplicated",
      "compiled": true,
      "compiled_code": "-- Flags republication double counts without dropping them. Removing rows here\n-- would change published counts silently; downstream picks the filter.\n-- Highest filename sorts last for the -v2/-v3 and -02 suffix conventions.\nwith ranked as (\n\n    select\n        c.*,\n        q.quality_class,\n        case\n            when q.quality_class = 'republished'\n            then row_number() over (\n                partition by c.complaint_num\n                order by c.pdf_filename desc\n            )\n            else 1\n        end as republication_rank\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\" as c\n    left join \"opcrime_dbt\".\"main\".\"int_complaint_quality\" as q\n        on c.complaint_num = q.complaint_num\n\n)\n\nselect\n    *,\n    republication_rank > 1 as is_duplicate_republication\nfrom ranked",
      "relation_name": "\"opcrime_dbt\".\"main\".\"int_crimes_deduplicated\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.277548Z",
          "completed_at": "2026-10-15T17:01:09.293547Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.294546Z",
          "completed_at": "2026-10-15T17:01:09.318547Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.04599881172180176,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_int_crimes_deduplicated_record_id.0df7ac1aa0",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_deduplicated\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.328549Z",
          "completed_at": "2026-10-15T17:01:09.349546Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.350546Z",
          "completed_at": "2026-10-15T17:01:09.457068Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.136521577835083,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_int_crimes_deduplicated_record_id.2547e62b59",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_deduplicated\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.217546Z",
          "completed_at": "2026-10-15T17:01:09.227549Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.228548Z",
          "completed_at": "2026-10-15T17:01:09.509071Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.29752254486083984,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.data_parity_summary",
      "compiled": true,
      "compiled_code": "-- Does the SQL agree with the Python it reimplements?\n--\n-- One rule in this project exists twice. assign_zones() in prepare_crime_db.py\n-- assigns each incident to a policing zone and stores the answer in\n-- crimes.parquet; int_crimes_zoned recomputes it from the polygons with\n-- ST_Contains and the same snap tolerance. Two implementations of one rule is a\n-- liability unless something compares them, so this does.\n--\n-- It is a value check, not a count check. The row counts would agree perfectly\n-- even if every incident landed in the wrong zone, because the same rows come out\n-- either way. Only comparing the assignments catches a real divergence, which is\n-- the kind that appears when someone tunes SNAP_TOL in the Python and nothing\n-- tells the SQL.\n--\n-- Twenty rows are expected to disagree and are excluded from the failure\n-- condition rather than from the count. Zone polygons share edges, so a point on a\n-- boundary is genuinely inside two of them. This project breaks the tie on the\n-- lowest zone_id; the pipeline breaks it differently. Both answers are defensible,\n-- neither is wrong, and int_crimes_zoned flags every such row as\n-- zone_boundary_ambiguous so the disagreement stays visible instead of being\n-- quietly absorbed.\n\nwith compared as (\n    select\n        p.record_id,\n        p.zone_id as pipeline_zone_id,\n        d.zone_id as dbt_zone_id,\n        d.zone_boundary_ambiguous,\n        p.zone_id is not distinct from d.zone_id as agrees\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\" as p\n    join \"opcrime_dbt\".\"main\".\"int_crimes_zoned\" as d using (record_id)\n),\n\nrolled as (\n    select\n        count(*) as rows_compared,\n        count(*) filter (where agrees) as assignments_agree,\n        count(*) filter (where not agrees) as assignments_differ,\n        count(*) filter (where not agrees and zone_boundary_ambiguous)\n            as differ_on_shared_boundary,\n        count(*) filter (where not agrees and not zone_boundary_ambiguous)\n            as differ_unexplained,\n        count(*) filter (where pipeline_zone_id is null and dbt_zone_id is not null)\n            as dbt_assigned_pipeline_did_not,\n        count(*) filter (where pipeline_zone_id is not null and dbt_zone_id is null)\n            as pipeline_assigned_dbt_did_not\n    from compared\n)\n\nselect 'zone_rows_compared' as measure, 'count' as check_kind,\n       rows_compared::double as value, 0.0 as expected,\n       'Incidents where both implementations produced an answer to compare.' as detail\nfrom rolled\nunion all\nselect 'zone_assignments_agree', 'count', assignments_agree::double, rows_compared::double,\n       'Incidents where the SQL and the Python chose the same zone, null included.'\nfrom rolled\nunion all\nselect 'zone_match_rate_pct', 'value',\n       round(assignments_agree * 100.0 / nullif(rows_compared, 0), 3), 100.0,\n       'Agreement rate. Expected to sit just under 100 because of the shared-boundary ties.'\nfrom rolled\nunion all\nselect 'zone_differ_on_shared_boundary', 'count', differ_on_shared_boundary::double, 0.0,\n       'Disagreements on points inside two polygons at once. Expected, flagged, and not a defect.'\nfrom rolled\nunion all\nselect 'zone_differ_unexplained', 'count', differ_unexplained::double, 0.0,\n       'Disagreements with no boundary ambiguity to explain them. Must be zero: anything here means the two implementations have actually drifted.'\nfrom rolled\nunion all\nselect 'zone_dbt_assigned_pipeline_did_not', 'count', dbt_assigned_pipeline_did_not::double, 0.0,\n       'The SQL placed an incident in a zone the Python left unassigned. A tolerance difference would show up here first.'\nfrom rolled\nunion all\nselect 'zone_pipeline_assigned_dbt_did_not', 'count', pipeline_assigned_dbt_did_not::double, 0.0,\n       'The Python placed an incident the SQL left unassigned. The other direction of the same drift.'\nfrom rolled",
      "relation_name": "\"opcrime_dbt\".\"main\".\"data_parity_summary\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.240547Z",
          "completed_at": "2026-10-15T17:01:09.247549Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.249550Z",
          "completed_at": "2026-10-15T17:01:09.538072Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.3045206069946289,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.dim_zone",
      "compiled": true,
      "compiled_code": "-- Geometry is dropped here; parquet has no native GEOMETRY type and no consumer\n-- needs the polygon, only the label.\nselect\n    z.zone_id,\n    z.zone_name,\n    count(c.record_id) as incident_count\n\nfrom \"opcrime_dbt\".\"main\".\"stg_policing_zones\" as z\nleft join \"opcrime_dbt\".\"main\".\"int_crimes_zoned\" as c\n    on c.zone_id = z.zone_id\ngroup by z.zone_id, z.zone_name",
      "relation_name": "\"opcrime_dbt\".\"main\".\"dim_zone\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.551068Z",
          "completed_at": "2026-10-15T17:01:09.579070Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.580069Z",
          "completed_at": "2026-10-15T17:01:09.605070Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.06199812889099121,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_dim_zone_zone_id__1__2__3__4__5__6__7__8.cf61ce4a14",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        zone_id as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"dim_zone\"\n    group by zone_id\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    '1','2','3','4','5','6','7','8'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.560068Z",
          "completed_at": "2026-10-15T17:01:09.582068Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.583072Z",
          "completed_at": "2026-10-15T17:01:09.611072Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.07000303268432617,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_dim_zone_zone_id.3a05163d64",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect zone_id\nfrom \"opcrime_dbt\".\"main\".\"dim_zone\"\nwhere zone_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:09.569072Z",
          "completed_at": "2026-10-15T17:01:09.583072Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:09.586072Z",
          "completed_at": "2026-10-15T17:01:09.613072Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.07000041007995605,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_dim_zone_zone_id.1c0e8418c5",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    zone_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"dim_zone\"\nwhere zone_id is not null\ngroup by zone_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:07.049295Z",
          "completed_at": "2026-10-15T17:01:07.089295Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:07.093295Z",
          "completed_at": "2026-10-15T17:01:11.129174Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 4.141877174377441,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_stg_geocode_cache_location_key.4980bb7065",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    location_key as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"stg_geocode_cache\"\nwhere location_key is not null\ngroup by location_key\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:11.150173Z",
          "completed_at": "2026-10-15T17:01:11.154173Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:11.155173Z",
          "completed_at": "2026-10-15T17:01:14.981186Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 3.834012031555176,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.geocode_coverage",
      "compiled": true,
      "compiled_code": "-- Measures how well the dbt-side naive join key matches the shared geocode cache.\n-- It does NOT measure whether the pipeline resolved an address: 15,431 rows that\n-- this join fails to match are geocoded perfectly well, because the pipeline keys\n-- on normalize_location() output while dbt only has lower(trim(location)).\n--\n-- The operational geocode signal is pipeline_has_coords. The naive key exists to\n-- quantify what publishing a real location_key upstream would buy.\nselect\n    c.record_id,\n    c.source,\n    c.location,\n    c.location_key_naive,\n    c.lat  as pipeline_lat,\n    c.long as pipeline_long,\n    g.lat  as cache_lat,\n    g.long as cache_long,\n    case\n        when g.location_key is null then 'unmatched'\n        when g.known_unresolvable   then 'cached_unresolvable'\n        else 'matched'\n    end as naive_key_status,\n    c.lat is not null as pipeline_has_coords\n\nfrom \"opcrime_dbt\".\"main\".\"stg_crimes\" as c\nleft join \"opcrime_dbt\".\"main\".\"stg_geocode_cache\" as g\n    on c.location_key_naive = g.location_key",
      "relation_name": "\"opcrime_dbt\".\"main\".\"geocode_coverage\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:14.998185Z",
          "completed_at": "2026-10-15T17:01:15.056184Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.057186Z",
          "completed_at": "2026-10-15T17:01:15.091186Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.10499906539916992,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_geocode_coverage_naive_key_status__matched__unmatched__cached_unresolvable.865041698b",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        naive_key_status as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"geocode_coverage\"\n    group by naive_key_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'matched','unmatched','cached_unresolvable'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.024183Z",
          "completed_at": "2026-10-15T17:01:15.057186Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.061186Z",
          "completed_at": "2026-10-15T17:01:15.093184Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.10899996757507324,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_geocode_coverage_record_id.55cce1b548",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"geocode_coverage\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.046184Z",
          "completed_at": "2026-10-15T17:01:15.060182Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.066182Z",
          "completed_at": "2026-10-15T17:01:15.100186Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.11400341987609863,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_geocode_coverage_record_id.6c8966f3cc",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"geocode_coverage\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.032191Z",
          "completed_at": "2026-10-15T17:01:15.059182Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.063182Z",
          "completed_at": "2026-10-15T17:01:15.104184Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.11600208282470703,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.relationships_geocode_coverage_record_id__record_id__ref_stg_crimes_.c0d3f41636",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith child as (\n    select record_id as from_field\n    from \"opcrime_dbt\".\"main\".\"geocode_coverage\"\n    where record_id is not null\n),\n\nparent as (\n    select record_id as to_field\n    from \"opcrime_dbt\".\"main\".\"stg_crimes\"\n)\n\nselect\n    from_field\n\nfrom child\nleft join parent\n    on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.116182Z",
          "completed_at": "2026-10-15T17:01:15.120182Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.121182Z",
          "completed_at": "2026-10-15T17:01:15.645278Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.5320985317230225,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.fct_incidents",
      "compiled": true,
      "compiled_code": "select\n    c.record_id,\n    c.complaint_num,\n    c.join_key,\n    c.source,\n    c.date,\n    cast(c.date as date)          as date_day,\n    c.offense,\n    c.primary_nibrs_code,\n    c.primary_crime_against,\n    c.primary_offense_type,\n    c.charge_count,\n    c.location,\n    c.lat,\n    c.long,\n    z.zone_id,\n    z.zone_name,\n    z.zone_status,\n    g.pipeline_has_coords         as has_coords,\n    c.quality_class               as complaint_quality_class,\n    c.is_duplicate_republication,\n    c.pdf_filename,\n    c.pdf_url,\n    c.block_position,\n    c.incident_id_raw,\n    c.occur_datetime,\n    c.date_mismatch\n\nfrom \"opcrime_dbt\".\"main\".\"int_crimes_deduplicated\" as c\nleft join \"opcrime_dbt\".\"main\".\"int_crimes_zoned\"   as z on c.record_id = z.record_id\nleft join \"opcrime_dbt\".\"main\".\"geocode_coverage\"   as g on c.record_id = g.record_id",
      "relation_name": "\"opcrime_dbt\".\"main\".\"fct_incidents\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.662279Z",
          "completed_at": "2026-10-15T17:01:15.699279Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.700279Z",
          "completed_at": "2026-10-15T17:01:15.735282Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.08999943733215332,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_fct_incidents_primary_crime_against__Person__Property__Society.dd9060a007",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        primary_crime_against as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    group by primary_crime_against\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'Person','Property','Society'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.672278Z",
          "completed_at": "2026-10-15T17:01:15.700279Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.703280Z",
          "completed_at": "2026-10-15T17:01:15.737281Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.08999896049499512,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_fct_incidents_source__pdf__dashboard__both.7bf25a490b",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        source as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    group by source\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'pdf','dashboard','both'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.680281Z",
          "completed_at": "2026-10-15T17:01:15.703280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.707280Z",
          "completed_at": "2026-10-15T17:01:15.740280Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.09100031852722168,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.accepted_values_fct_incidents_zone_status__in_village__snapped__outside_village__ungeocoded.fb79efe54c",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nwith all_values as (\n\n    select\n        zone_status as value_field,\n        count(*) as n_records\n\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    group by zone_status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n    'in_village','snapped','outside_village','ungeocoded'\n)\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.689278Z",
          "completed_at": "2026-10-15T17:01:15.706278Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.710281Z",
          "completed_at": "2026-10-15T17:01:15.745280Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.09499979019165039,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.dbt_utils_unique_combination_of_columns_fct_incidents_pdf_filename__block_position.bc10c60809",
      "compiled": true,
      "compiled_code": "\n\n\n\n\n\nwith validation_errors as (\n\n    select\n        pdf_filename, block_position\n    from (select * from \"opcrime_dbt\".\"main\".\"fct_incidents\" where pdf_filename is not null) dbt_subquery\n    group by pdf_filename, block_position\n    having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.764278Z",
          "completed_at": "2026-10-15T17:01:15.791280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.791280Z",
          "completed_at": "2026-10-15T17:01:15.816283Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.061998844146728516,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_fct_incidents_record_id.f2ce792ed4",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect record_id\nfrom \"opcrime_dbt\".\"main\".\"fct_incidents\"\nwhere record_id is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.773278Z",
          "completed_at": "2026-10-15T17:01:15.794280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.795282Z",
          "completed_at": "2026-10-15T17:01:15.820281Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.06700253486633301,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_fct_incidents_zone_status.c75faf4e88",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect zone_status\nfrom \"opcrime_dbt\".\"main\".\"fct_incidents\"\nwhere zone_status is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.781278Z",
          "completed_at": "2026-10-15T17:01:15.794280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.798280Z",
          "completed_at": "2026-10-15T17:01:15.825280Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.06899547576904297,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_fct_incidents_record_id.f48c591969",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    record_id as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"fct_incidents\"\nwhere record_id is not null\ngroup by record_id\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.851283Z",
          "completed_at": "2026-10-15T17:01:15.862282Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.874281Z",
          "completed_at": "2026-10-15T17:01:16.110279Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.2709963321685791,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.data_profile_summary",
      "compiled": true,
      "compiled_code": "-- Characteristics of the dataset that are correct but surprising, kept separate\n-- from data_quality_summary so neither table misleads. Nothing here is a defect.\nwith checks as (\n\n    select 'geocoded' as measure,\n           'Incidents with coordinates resolved' as description,\n           count(*) filter (where lat is not null) as row_count,\n           count(*) as denominator\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'in_village',\n           'Geocoded inside one of the 8 policing zone polygons',\n           count(*) filter (where zone_status = 'in_village'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'zone_snapped',\n           'Attached to a zone by the 55m nearest-zone fallback rather than strict containment',\n           count(*) filter (where zone_status = 'snapped'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'outside_village',\n           'Geocoded outside the village. Correct: OPPD reports incidents in neighbouring towns',\n           count(*) filter (where zone_status = 'outside_village'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'pdf_only',\n           'Present in the PDF activity reports only, so no NIBRS coding or exact timestamp',\n           count(*) filter (where source = 'pdf'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'dashboard_only',\n           'Present in the Power BI export only, so no narrative text',\n           count(*) filter (where source = 'dashboard'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n    union all\n    select 'both_sources',\n           'Matched across both ingest streams and merged',\n           count(*) filter (where source = 'both'), count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n\n)\n\nselect\n    measure,\n    description,\n    row_count,\n    round(100.0 * row_count / denominator, 2) as pct_of_rows\nfrom checks\norder by row_count desc",
      "relation_name": "\"opcrime_dbt\".\"main\".\"data_profile_summary\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.855278Z",
          "completed_at": "2026-10-15T17:01:15.868280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.880280Z",
          "completed_at": "2026-10-15T17:01:16.121278Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.28499650955200195,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.data_quality_summary",
      "compiled": true,
      "compiled_code": "-- Actual defects only. Expected characteristics of the data live in\n-- data_profile_summary: a row whose owner reads \"not a defect\" does not belong in\n-- a defect table, and mixing the two buries the real numbers under large\n-- harmless ones.\nwith checks as (\n\n    select 'republished_pdf_rows' as issue,\n           'Same incident ingested twice under a revised PDF filename' as description,\n           'ingest bug, fix in drop_exact_source_duplicates' as owner,\n           count(*) as row_count\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where is_duplicate_republication\n\n    union all\n    select 'complaint_collisions',\n           'One complaint number on materially different incidents',\n           'source data, flag only',\n           count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where complaint_quality_class = 'collision'\n\n    union all\n    select 'ungeocoded',\n           'No coordinates resolved',\n           'run a Python cache-fill',\n           count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where lat is null\n\n    union all\n    select 'date_sentinel',\n           'Date failed to parse and fell back to 1900-01-01',\n           'source data, flag only',\n           count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where date <= '1901-01-01'\n\n    union all\n    select 'date_future',\n           'Incident date is in the future',\n           'source data, poisons naive freshness checks',\n           count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where date > current_date\n\n    union all\n    select 'pdf_dashboard_date_mismatch',\n           'PDF and dashboard disagree on the incident date by a day or more',\n           'flagged in merge_notes, not repaired',\n           count(*)\n    from \"opcrime_dbt\".\"main\".\"fct_incidents\"\n    where date_mismatch\n\n)\n\nselect\n    issue,\n    description,\n    owner,\n    row_count,\n    round(100.0 * row_count / (select count(*) from \"opcrime_dbt\".\"main\".\"fct_incidents\"), 2) as pct_of_rows\nfrom checks\norder by row_count desc",
      "relation_name": "\"opcrime_dbt\".\"main\".\"data_quality_summary\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.848278Z",
          "completed_at": "2026-10-15T17:01:15.861280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.863281Z",
          "completed_at": "2026-10-15T17:01:16.159282Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.33100199699401855,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.agg_offense_trends",
      "compiled": true,
      "compiled_code": "select\n    offense,\n    primary_crime_against,\n    strftime(date, '%Y-%m')       as year_month,\n    year(date)                    as year,\n    count(*)                      as incident_count,\n    count(distinct zone_id)       as zones_touched,\n    count(*) filter (where zone_status = 'outside_village') as outside_village_count\n\nfrom \"opcrime_dbt\".\"main\".\"fct_incidents\"\nwhere date > '1901-01-01'\n  and offense is not null\ngroup by offense, primary_crime_against, year_month, year",
      "relation_name": "\"opcrime_dbt\".\"main\".\"agg_offense_trends\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "success",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:15.844281Z",
          "completed_at": "2026-10-15T17:01:15.862282Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:15.869282Z",
          "completed_at": "2026-10-15T17:01:16.172278Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.3370020389556885,
      "adapter_response": {
        "_message": "OK"
      },
      "message": "OK",
      "failures": null,
      "unique_id": "model.opcrime.agg_incidents_by_zone_month",
      "compiled": true,
      "compiled_code": "select\n    zone_id,\n    zone_name,\n    zone_status,\n    strftime(date, '%Y-%m')                     as year_month,\n    year(date)                                  as year,\n    month(date)                                 as month,\n    count(*)                                    as incident_count,\n    count(*) filter (where not is_duplicate_republication) as deduplicated_count,\n    count(distinct complaint_num)               as distinct_complaints,\n    count(*) filter (where primary_crime_against = 'Person')   as crimes_against_person,\n    count(*) filter (where primary_crime_against = 'Property') as crimes_against_property,\n    count(*) filter (where primary_crime_against = 'Society')  as crimes_against_society\n\nfrom \"opcrime_dbt\".\"main\".\"fct_incidents\"\nwhere date > '1901-01-01'\ngroup by zone_id, zone_name, zone_status, year_month, year, month",
      "relation_name": "\"opcrime_dbt\".\"main\".\"agg_incidents_by_zone_month\"",
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:16.137278Z",
          "completed_at": "2026-10-15T17:01:16.152280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:16.154277Z",
          "completed_at": "2026-10-15T17:01:16.204282Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.09100198745727539,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_data_profile_summary_measure.40fb22e1f7",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect measure\nfrom \"opcrime_dbt\".\"main\".\"data_profile_summary\"\nwhere measure is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:16.160283Z",
          "completed_at": "2026-10-15T17:01:16.175283Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:16.178281Z",
          "completed_at": "2026-10-15T17:01:16.231279Z"
        }
      ],
      "thread_id": "Thread-4 (worker)",
      "execution_time": 0.08500027656555176,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_data_profile_summary_measure.7f9c77007d",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    measure as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"data_profile_summary\"\nwhere measure is not null\ngroup by measure\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:16.194282Z",
          "completed_at": "2026-10-15T17:01:16.214278Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:16.218280Z",
          "completed_at": "2026-10-15T17:01:16.259280Z"
        }
      ],
      "thread_id": "Thread-2 (worker)",
      "execution_time": 0.07600188255310059,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_data_quality_summary_issue.1106ffc071",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect issue\nfrom \"opcrime_dbt\".\"main\".\"data_quality_summary\"\nwhere issue is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:16.207280Z",
          "completed_at": "2026-10-15T17:01:16.222280Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:16.224281Z",
          "completed_at": "2026-10-15T17:01:16.263281Z"
        }
      ],
      "thread_id": "Thread-1 (worker)",
      "execution_time": 0.07700085639953613,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.not_null_data_quality_summary_row_count.cceafbb9a7",
      "compiled": true,
      "compiled_code": "\n    \n    \n\n\n\nselect row_count\nfrom \"opcrime_dbt\".\"main\".\"data_quality_summary\"\nwhere row_count is null\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    },
    {
      "status": "pass",
      "timing": [
        {
          "name": "compile",
          "started_at": "2026-10-15T17:01:16.241282Z",
          "completed_at": "2026-10-15T17:01:16.253281Z"
        },
        {
          "name": "execute",
          "started_at": "2026-10-15T17:01:16.254283Z",
          "completed_at": "2026-10-15T17:01:16.278279Z"
        }
      ],
      "thread_id": "Thread-3 (worker)",
      "execution_time": 0.04399871826171875,
      "adapter_response": {
        "_message": "OK"
      },
      "message": null,
      "failures": 0,
      "unique_id": "test.opcrime.unique_data_quality_summary_issue.257f0ff4ff",
      "compiled": true,
      "compiled_code": "\n    \n    \n\nselect\n    issue as unique_field,\n    count(*) as n_records\n\nfrom \"opcrime_dbt\".\"main\".\"data_quality_summary\"\nwhere issue is not null\ngroup by issue\nhaving count(*) > 1\n\n\n",
      "relation_name": null,
      "batch_results": null,
      "overload_results": null
    }
  ],
  "elapsed_time": 10.174036741256714,
  "args": {
    "note": "removed before publish; contained local filesystem paths"
  }
}