<jupyter_start><jupyter_text>Liste fehlerhafter Events<jupyter_code>df = pd.read_sql("""
    select
        event_log.id as event_log_id,
        event_log.uuid_id as event_log_uuid,
        event_parameter.id as event_parameter_id,
        event_parameter_uuid.id as event_parameter_uuid_id,
        event_parameter_uuid.uuid_id as event_parameter_uuid_uuid
    from event_log
    join event_parameter on event_parameter.log_id = event_log.id
    join event_parameter_uuid on event_parameter_uuid.event_parameter_id = event_parameter.id
    join uuid on uuid.id = event_log.uuid_id
    where event_log.event_id = 9
        and uuid.discriminator != "comment";
""", db)
df<jupyter_output><empty_output><jupyter_text>Generierung der Updates<jupyter_code>for i, row in df.iterrows():
    # Swap uuid and uuid_parameter
    print("update event_parameter_uuid set uuid_id = "
          + str(row["event_log_uuid"])
          + " where id = "
          + str(row["event_parameter_uuid_id"])
          + ";")
    
    print("update event_log set uuid_id = "
         + str(row["event_parameter_uuid_uuid"])
         + " where id = "
         + str(row["event_log_id"])
         + ";")
    
    # Fix event_paramater_name to "on"
    print("update event_parameter set name_id = 4 where id = "
         + str(row["event_parameter_id"]) + ";")
    
    # Fix event_type to create_thread
    print("update event_log set event_id = 8 where id = "
         + str(row["event_log_id"]) + ";")
for i, row in df.iterrows():
    print("redis_del('de.serlo.org/api/event/" + str(row["event_log_id"]) + "');")<jupyter_output>redis_del('de.serlo.org/api/event/405293');
redis_del('de.serlo.org/api/event/406265');
redis_del('de.serlo.org/api/event/406273');
redis_del('de.serlo.org/api/event/409132');
redis_del('de.serlo.org/api/event/410231');
redis_del('de.serlo.org/api/event/412089');
redis_del('de.serlo.org/api/event/412779');
redis_del('de.serlo.org/api/event/413198');
redis_del('de.serlo.org/api/event/413208');
redis_del('de.serlo.org/api/event/413571');
redis_del('de.serlo.org/api/event/413615');
redis_del('de.serlo.org/api/event/415029');
redis_del('de.serlo.org/api/event/415048');
redis_del('de.serlo.org/api/event/417535');
{'fraction_non_alphanumeric': 0.14407924358397117, 'fraction_numerical': 0.039171544349392164, 'mean_word_length': 3.788793103448276, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '528438', 'license': 'CC0-1.0', 'n_tokens_mistral': 879, 'n_tokens_neox': 829, 'n_words': 116, 'path': '2021/2021-07-08 Fix SQL after bug.ipynb', 'repo_name': 'kulla/serlo-evaluations', 'size': '2221'}