boyan-soubachov / tastyworks_api

An unofficial, reverse-engineered Python API for tastyworks.
Apache License 2.0
208 stars 79 forks source link

KeyError: 'price-effect' from OrderPriceEffect(input_dict['price-effect']) when running example.py #60

Open BrettBiba opened 3 years ago

BrettBiba commented 3 years ago

Describe the bug KeyError: 'price-effect' from OrderPriceEffect(input_dict['price-effect']) when running example.py unmodified, except for username and password.

To Reproduce Steps to reproduce the behavior:

  1. Add username and password
  2. python example.py

Actual behavior The account loads fine but then I received the following error:

Traceback (most recent call last): File "/opt/anaconda3/lib/python3.8/site-packages/tastyworks/example.py", line 95, in main loop.run_until_complete(main_loop(tasty_client, streamer)) File "/opt/anaconda3/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/opt/anaconda3/lib/python3.8/site-packages/tastyworks/example.py", line 38, in main_loop orders = await Order.get_remote_orders(session, acct) File "/opt/anaconda3/lib/python3.8/site-packages/tastyworks/models/order.py", line 141, in get_remote_orders order = cls.from_dict(order_data) File "/opt/anaconda3/lib/python3.8/site-packages/tastyworks/models/order.py", line 101, in from_dict details.price_effect = OrderPriceEffect(input_dict['price-effect']) KeyError: 'price-effect'

Expected behavior example.py to run without issues. :-)

Enviroment I am running from Terminal on macOS 11.2.1(M1) using Python 3.8 provided by Anaconda3.