def test_from_dict_returns_expected_bar(self): # Arrange bar = TestDataStubs.bar_5decimal() # Act result = Bar.from_dict(Bar.to_dict(bar)) # Assert assert result == bar
def deserialize(data: Dict) -> Bar: ignore = ("instrument_id", ) bar = Bar.from_dict({k: v for k, v in data.items() if k not in ignore}) return bar