9b7b23fd9bbc8baad2d2f88c1a66a2547683cd40,examples/dataflow-data-generator/data-generator-pipeline/data_generator/AvroUtil.py,,fix_record_for_avro,#Any#Any#,21

Before Change


def fix_record_for_avro(record, avro_schema):
    for field in avro_schema.fields:
        field_name = field.name
        datatype = field.type.to_json()
        if isinstance(datatype, dict):
            // This is a record type definition so we need to recurse a level deeper.
            record[field_name] = fix_record_for_avro(
                record[field_name], avro.schema.Parse(json.dumps(datatype)))[0]

After Change




def fix_record_for_avro(record, avro_schema):
    for field in avro_schema["fields"]:
        field_name = field["name"]
        datatype = field["type"]
        if isinstance(datatype, dict):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: GoogleCloudPlatform/professional-services
Commit Name: 9b7b23fd9bbc8baad2d2f88c1a66a2547683cd40
Time: 2020-02-24
Author: jferriero@google.com
File Name: examples/dataflow-data-generator/data-generator-pipeline/data_generator/AvroUtil.py
Class Name:
Method Name: fix_record_for_avro


Project Name: nilmtk/nilmtk
Commit Name: df7ccde5e74141181d6576c0247bf7ea14561873
Time: 2013-12-14
Author: nipunreddevil@gmail.com
File Name: nilmtk/dataset/dataset.py
Class Name: DataSet
Method Name: to_json


Project Name: chartbeat-labs/textacy
Commit Name: 800dcf66028cc6d35a9d3984d9bff1992a13f16e
Time: 2016-02-11
Author: burton@chartbeat.com
File Name: textacy/data.py
Class Name:
Method Name: load_depechemood