def get_schema_dict(record, state=None):
    state = state or SchemaGeneratorState()

    full_name = core.get_full_name(record)
    if state.declared_records in full_name:
        return full_name
    state.declared_records.add(full_name)

    if '.' in full_name:
        namespace, _ = full_name.rsplit('.', 1)
    else:
        namespace = None

    avro_record = {
        "type": "record",
        "name": record._schema_name,
    }
    if namespace:
        avro_record["namespace"] = namespace

    if record.__doc__ is not None:
        avro_record["doc"] = record.__doc__

    avro_fields = []
    for field_name, field_type in record._fields.iteritems():
        field_spec = {
            "name": field_name,
            "type": field_type.avro_type_schema(state)
        }
        if field_type.default is not core.NO_DEFAULT:
            field_spec["default"] = field_type.avro_default_value()
        if field_type.description is not None:
            field_spec["doc"] = field_type.description
        avro_fields.append(field_spec)

    avro_record["fields"] = avro_fields
    return avro_record
dataset/ETHPy150Open spotify/pyschema/pyschema_extensions/avro.py/get_schema_dict/swapped operands of `in`