I stumbled upon a problem, when I was working on my ETL pipeline. I am using dataclasses dataclass to parse JSON objects. One of the keywords of the JSON object is a reserved keyword. Is there a way around this:
from dataclasses import dataclass
import jsons
out = {"yield": 0.21}
@dataclass
class PriceObj:
    asOfDate: str
    price: float
    yield: float
jsons.load(out, PriceObj)
This will obviously fail because yield is reserved. Looking at the dataclasses field definition, there doesn't seem to be anything in there that can help.
Go, allows one to define the name of the JSON field, wonder if there is such a feature in the dataclass?
 
     
    