Skip to content

pydantic errors #1

@akovachev

Description

@akovachev

I'm getting the following error when trying to do get_balances on a cash acct:

>>> t.get_balances()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/tradier_python/tradier_api.py", line 80, in get_balances
    res = AccountsAPIResponse(**data)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for AccountsAPIResponse
balances.margin
  Field required [type=missing, input_value={'option_short_value': 0,..., 'unsettled_funds': 0}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing
balances.pdt
  Field required [type=missing, input_value={'option_short_value': 0,..., 'unsettled_funds': 0}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions