How to specify python faust.Record field which name starts with numbers?

I'm describing faust model by extending faust.Record class. My input json looks like:

{
  "1": "some_string"
  "2": "some_string"
}

So I have to create class fields, named with numbers only. I know, it restricted in Python in general, but is there any workarounds, like aliases for my fieds names?

I'm looking for something like Jackson annotations in Java:

import faust

class Model(faust.Record, serializer='json'):
    @alias(field_name: '1')
    first_name: str
    @alias(field_name: '2')
    last_name: str


from Recent Questions - Stack Overflow https://ift.tt/2QT5918
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Network Error and Timeout on Authorize.net JS

Spring Elasticsearch Operations