File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -147,20 +147,11 @@ Decode an event in Avro:
147147``` python
148148from spce import Avro
149149
150- text = """
151- {
152- "type": "OximeterMeasured",
153- "source": "oximeter/123",
154- "id": "1000",
155- "specversion": "1.0",
156- "datacontenttype": "application/json",
157- "subject": "subject1",
158- "dataschema": "https://particlemetrics.com/schema",
159- "time": "2020-09-28T21:33:21Z",
160- "data": "{\" spo2\" : 99})"
161- }
162- """
163- decoded_event = Avro.decode(text)
150+ encoded_event = \
151+ (b ' \n\x08 type\x06 OximeterMeasured\x0c source\x06\x18 oximeter/123\x04 id'
152+ b ' \x06\x08 1000\x16 specversion\x06\x06 1.0\x1e datacontenttype\x06 application'
153+ b ' /json\x00\x0c\x18 {"spo2": 99}' )
154+ decoded_event = Avro.decode(encoded_event)
164155```
165156
166157## License
You can’t perform that action at this time.
0 commit comments