Skip to content

Instantly share code, notes, and snippets.

@billydh
Last active April 28, 2020 04:13
Show Gist options
  • Select an option

  • Save billydh/f32b5271da92baf9948e8889ecf0e1a5 to your computer and use it in GitHub Desktop.

Select an option

Save billydh/f32b5271da92baf9948e8889ecf0e1a5 to your computer and use it in GitHub Desktop.
A util function to load Avro schema from file
from confluent_kafka import avro
def load_avro_schema_from_file(schema_file):
key_schema_string = """
{"type": "string"}
"""
key_schema = avro.loads(key_schema_string)
value_schema = avro.load("./avro/" + schema_file)
return key_schema, value_schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment