Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base.py #54

Closed
wants to merge 1 commit into from
Closed

Conversation

kartiksubbarao
Copy link

Only join symbols if passed as a list, fixes #53

Only join symbols if passed as a list, fixes alexgolec#53
@kolyarice
Copy link

kolyarice commented May 11, 2024

testing this fix this morning, I found that the API returns an error if the length of the symbols search str is too short:

In [2]: r = c.get_instruments(symbols='A.*', projection=schwab.client.Client.Instrument.Projection.SYMBOL_REGEX)

In [3]: r.json()
Out[3]:
{'errors': [{'id': 'e86350c5-ee29-43ff-ac71-e57dc90a9155',
   'status': '400',
   'title': 'Bad Request',
   'detail': 'Symbol length should be atleast : 4',
   'source': {'parameter': 'symbol'}}]}

testing with AA.* succeeded ✅
(testing with [A].* failed successfully, because the result set was too large)

@alexgolec
Copy link
Owner

This is not currently intended functionality. Closing for now.

@alexgolec alexgolec closed this May 17, 2024
@pengdahl
Copy link

pengdahl commented Jun 2, 2024

Please re-open this request. It is not possible to use symbol-regex in get_instruments with the current version. I had to fork this repo in order to fix this myself since I use symbol-regex.

@kartiksubbarao
Copy link
Author

@pengdahl FYI the corresponding issue is #53 which is still open. I followed up there with @alexgolec since I didn't understand his response here. Hopefully he can respond with some more clarification.

@pengdahl
Copy link

pengdahl commented Jun 3, 2024 via email

@kartiksubbarao kartiksubbarao deleted the patch-1 branch June 30, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_instruments() inserts commas for non-list symbol parameter
4 participants