You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of Bug
When attempting to query orders with multiple statuses such as FILLED and QUEUED , a 400 "error" : "'FILLED,QUEUED' is not a valid Order Status.... is returned as the response.
Code to Reproduce
client = tda.auth.client_from_token_file(token_path, api_key)
my_statuses = [
tda.client.Client.Order.Status.FILLED,
tda.client.Client.Order.Status.QUEUED,
]
orders = client.get_orders_by_query(statuses=my_statuses)
print(orders.content) # "error" : "\'FILLED,QUEUED\' is not a valid Order Status.
Expected Behavior
Expected the function to return a HTTP 200 Response object with orders containing the input statuses
Actual Behavior
Returned HTTP 400 Response indicating an error with the formatting of the query
I think the issue may be in line 178 in tda/client/base with the make_order_query() function.
def _make_order_query(self,
*,
max_results=None,
from_entered_datetime=None,
to_entered_datetime=None,
status=None,
statuses=None):
status = self.convert_enum(status, self.Order.Status)
statuses = self.convert_enum_iterable(statuses, self.Order.Status) # returns a list
if status:
params['status'] = status
if statuses:
params['status'] = ','.join(statuses) # I think this is causing the issue
return params
Description of Bug
When attempting to query orders with multiple statuses such as FILLED and QUEUED , a 400 "error" : "'FILLED,QUEUED' is not a valid Order Status.... is returned as the response.
Code to Reproduce
Expected Behavior
Expected the function to return a HTTP 200 Response object with orders containing the input statuses
Actual Behavior
Returned HTTP 400 Response indicating an error with the formatting of the query
Error/Exception Log, If Applicable
bug.log
The text was updated successfully, but these errors were encountered: