confluent-kafka-python
confluent-kafka-python copied to clipboard
No such file or directory: 'ValueSchema.avsc'
Hi,
I was trying to run the avro producer and got the following error.
value_schema = avro.load('ValueSchema.avsc') File "/usr/local/lib/python2.7/site-packages/confluent_kafka/avro/init.py", line 22, in load with open(fp) as f: IOError: [Errno 2] No such file or directory: 'ValueSchema.avsc'
Do we need to create ValueSchema.avsc and KeySchema.avcs file?
@ronaklotia Yes, you'd need to create those files. They would contain the avro schemas for your key and value. There is also a loads(schema) function that loads it from a string instead of loading from a file.
I can see why this question was raised. It would be great to have everything in the repo to make examples work out of the box (assuming you have the correct services running).
Maybe the example schemas could be inlined in the example code with loads(schema).
Will look into copying more modern examples into the repo with upcoming changes, but closing this old issue for now.