Skip to content

The method schema.Parse() should be lower case #1005

@casperlehmann

Description

Description

Capitalization of method name schema.Parse() has been deprecated since version 1.1.0 of avro-python3.

apache/avro#666

Meanwhile, avro-python3 is itself deprecated.

apache/avro@ad820ed

Future versions of the codebase should therefore look to implement the calls in accordance with the avro package instead of àvro-python3`.

How to reproduce

from confluent_kafka import avro
schema_string = avro.loads('''{
  "namespace": "com.example.test",
  "type": "record",
  "name": "test",
  "fields": [
    {
      "name": "test",
      "type": "string"
    }
  ]
}''')

Raises:

Traceback (most recent call last):
  File "my_error.py", line 7, in <module>
    schema_string = avro.loads('''{
  File "/Users/lricls/projects/bi-hub/.venv/lib/python3.8/site-packages/confluent_kafka/avro/load.py", line 29, in loads
    return schema.Parse(schema_str)
AttributeError: module 'avro.schema' has no attribute 'Parse'

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): ('1.5.0', 17104896), ('1.5.0', 17105151)
  • Apache Kafka broker version:
  • Client configuration: {...}
  • Operating system: MacOS 10.15.7
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions