d03c17c40a2f3874c6b901d75763dcfc1492955c,workers/data_refinery_workers/processors/no_op.py,,_no_op_processor_fn,#Any#,13

Before Change


        job_context["success"] = False
        return job_context

    try:
        file.remove_raw_files()
    except:
        // If we fail to remove the raw files, the job is still done
        // enough to call a success. However logging will be important
        // so the problem can be identified and the raw files cleaned up.
        logger.exception("Exception caught while removing raw file %s",
                         raw_path,
                         batch=file.batch.id,
                         processor_job=job_context["job_id"])

    job_context["success"] = True
    return job_context

After Change


    // Create a ComputedFile for the sample,
    // sync it S3 and save it.
    try:
        computed_file = ComputedFile()
        computed_file.absolute_file_path = sample.source_absolute_file_path
        computed_file.filename = sample.source_filename
        computed_file.calculate_sha1()
        computed_file.calculate_size()
        computed_file.result = result
        computed_file.sync_to_s3(S3_BUCKET_NAME, computed_file.sha1 + "_" + computed_file.filename)
        // TODO here: delete local file after S3 sync
        computed_file.save()
    except Exception:
        logger.exception("Exception caught while moving file %s",
                         raw_path,
                         processor_job=job_context["job_id"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: d03c17c40a2f3874c6b901d75763dcfc1492955c
Time: 2018-03-16
Author: rich@anomos.info
File Name: workers/data_refinery_workers/processors/no_op.py
Class Name:
Method Name: _no_op_processor_fn


Project Name: descarteslabs/descarteslabs-python
Commit Name: 0a683f79d74ac0c3aa2f1551d0b7123f06c49735
Time: 2019-10-30
Author: nik@descarteslabs.com
File Name: docs/examples/run_keras_model.py
Class Name:
Method Name:


Project Name: AlexsLemonade/refinebio
Commit Name: 86fa89f0f50e153d625108d93f1f9eb8ee59719e
Time: 2019-11-01
Author: davidsmejia@gmail.com
File Name: workers/data_refinery_workers/processors/create_compendia.py
Class Name:
Method Name: _create_result_objects