tastyware / tastytrade

An unofficial, sync/async Python SDK for Tastytrade!
https://tastyworks-api.rtfd.io
MIT License
127 stars 43 forks source link

AccountBalance throws exception on missing data #60

Closed jimbkim closed 1 year ago

jimbkim commented 1 year ago

in the account.py file, I updated the data class as follows because the API doesn't return these keys anymore, although it's still int he docs.

apex_starting_day_margin_equity: Decimal = Field(default = None)
buying_power_adjustment: Decimal = Field(default = None)
buying_power_adjustment_effect: PriceEffect = Field(default = PriceEffect.NONE)

I tried using Option, but didn't seem to work.

Graeme22 commented 1 year ago

The keys are still present for me, but looks like they're not guaranteed to be present! I'll make them optional. Thanks for identifying this!