Last active
April 28, 2020 04:13
-
-
Save billydh/f32b5271da92baf9948e8889ecf0e1a5 to your computer and use it in GitHub Desktop.
A util function to load Avro schema from file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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