<commit_before>from ..migrator import upgrade_step


@upgrade_step('workflow_run', '1', '2')
def workflow_run_1_2(value, system):
    # http://redmine.encodedcc.org/issues/2922

    value['dx_analysis_id'] = value.get('dx_workflow_id')
    del value['dx_workflow_id']
    del value['dx_workflow_json']<commit_msg>Conditional deletion of properties is required.<commit_after>from ..migrator import upgrade_step


@upgrade_step('workflow_run', '1', '2')
def workflow_run_1_2(value, system):
    # http://redmine.encodedcc.org/issues/2922

    if 'dx_workflow_id' in value:
        value['dx_analysis_id'] = value.get('dx_workflow_id')
        del value['dx_workflow_id']
    if 'dx_workflow_json' in value:
        del value['dx_workflow_json']
{'fraction_non_alphanumeric': 0.1334231805929919, 'fraction_numerical': 0.0215633423180593, 'mean_word_length': 4.850393700787402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '3728867', 'n_tokens_mistral': 270, 'n_tokens_neox': 258, 'n_words': 46}