alienbrett / PyAlly

Ally Invest API Module for Python3
https://alienbrett.github.io/PyAlly/
MIT License
57 stars 28 forks source link

KeyError: 'quotes' line 358, in submit_order #32

Closed eyesuk closed 4 years ago

eyesuk commented 4 years ago

Hello Everyone, I am running into an error when submitting an order. The order is placed successfully however, I receive the error below: 2020-04-26 15:08:02 Traceback (most recent call last): File "text-script", line 25, in <module> print(fill_order(order)) File "text-script", line 19, in fill_order preview=False File "~/ally/api_calls.py", line 357, in submit_order del results['quotes'] KeyError: 'quotes'

The error references this part of the api_calls.py, but I am unable to decipher the purpose of these lines.

if verbose:
    # Notice results will have different type, depending on verbose
    print(results['request'])
    print(results['response'])

else:
    # optionally throw away unsightly extra bullshit
    if discard_quotes:
    del results['quotes']

Hope everyone is safe and healthy πŸ‘πŸΎπŸ‘πŸΎ

JTraversa commented 4 years ago

It is just a section to parse out data based on whether you would like verbose data or not. I'm assuming that either in the past results['quotes'] sent back a lot of irrelevant information, or perhaps in your case it just isn't functioning properly.

Either way, you can just delete the entire if statement from your wrapper and it should function. If you arent using verbose responses then you wont be missing anything.

eyesuk commented 4 years ago

Thank you man!