-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Bug
TangoClient.list_entities() accepts a search keyword argument, and the docstring says it "maps to 'q' parameter." However, the implementation sends search as the literal query parameter name instead of q:
# In tango/client.py, list_entities():
# Map 'search' parameter to 'q' (query parameter)
if search:
params["search"] = search # Bug: should be params["q"] = searchThis causes the Tango API to return 400 Bad Request since it doesn't recognize search as a valid query parameter on /api/entities/.
Steps to reproduce
from tango import TangoClient
client = TangoClient()
# This sends GET /api/entities/?search=booz+allen+hamilton → 400 Bad Request
response = client.list_entities(search="booz allen hamilton")Expected behavior
The SDK should send q=booz+allen+hamilton in the query string, matching the API's expected parameter name and the docstring's documented behavior.
Workaround
Pass q directly as a filter kwarg:
# This works — sends GET /api/entities/?q=booz+allen+hamilton → 200 OK
response = client.list_entities(q="booz allen hamilton")Fix
In list_entities, change:
params["search"] = searchto:
params["q"] = searchReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels