<commit_before>WITH
    operator_first_view_after_cb1 as (
      SELECT
         o.id as o_id
        ,no.id as no_id
        ,no.code as code
        ,no.created
        ,row_number() over (PARTITION BY o.id order by no.id asc) as rn
      from cla_eventlog_log o
        JOIN cla_eventlog_log no on
                                   o.case_id = no.case_id
                                   and no.id > o.id
        JOIN call_centre_operator AS op ON no.created_by_id = op.user_id
      order by no.id asc

  ),

    operator_first_log_after_cb1 as (
      SELECT
         o.id as o_id
        ,no.id as no_id
        ,no.code as code
        ,no.created
        ,row_number() over (PARTITION BY o.id order by no.id asc) as rn
      from cla_eventlog_log o
        JOIN cla_eventlog_log no on
                                   o.case_id = no.case_id
                                   and no.id > o.id
        JOIN call_centre_operator AS op ON no.created_by_id = op.user_id
      WHERE no.level >= 29 and no.type = 'outcome'
      order by no.id asc

  ),
    all_rows as (
      select
         log.id as log_id
        ,c.id
        ,c.laa_reference as "LAA_Reference"
        ,md5(lower(regexp_replace((pd.full_name||pd.postcode)::text, '\s', '', 'ig'))) as "Hash_ID_personal_details_captured"
        ,c.reference as "Case_ID"<commit_msg>update SLA MI to look for events as well as outcomes<commit_after>WITH
    operator_first_view_after_cb1 as (
      SELECT
         o.id as o_id
        ,no.id as no_id
        ,no.code as code
        ,no.created
        ,row_number() over (PARTITION BY o.id order by no.id asc) as rn
      from cla_eventlog_log o
        JOIN cla_eventlog_log no on
                                   o.case_id = no.case_id
                                   and no.id > o.id
        JOIN call_centre_operator AS op ON no.created_by_id = op.user_id
      order by no.id asc

  ),

    operator_first_log_after_cb1 as (
      SELECT
         o.id as o_id
        ,no.id as no_id
        ,no.code as code
        ,no.created
        ,row_number() over (PARTITION BY o.id order by no.id asc) as rn
      from cla_eventlog_log o
        JOIN cla_eventlog_log no on
                                   o.case_id = no.case_id
                                   and no.id > o.id
        JOIN call_centre_operator AS op ON no.created_by_id = op.user_id
      WHERE no.level >= 29 and no.type in ('outcome', 'event')
      order by no.id asc

  ),
    all_rows as (
      select
         log.id as log_id
        ,c.id
        ,c.laa_reference as "LAA_Reference"
        ,md5(lower(regexp_replace((pd.full_name||pd.postcode)::text, '\s', '', 'ig'))) as "Hash_ID_personal_details_captured"
        ,c.reference as "Case_ID"
{'fraction_non_alphanumeric': 0.07650273224043716, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 1.5663551401869158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1776935', 'n_tokens_mistral': 937, 'n_tokens_neox': 912, 'n_words': 249}