massive-com / massive-com/client-python
Client get_ticket_types() errors out on "options" asset class
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 362
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
The get_ticker_types() and/or the /v3/reference/tickers/types behaves unexpectedly when "options" is used as a the asset class.
If I run the query in the documentation page, I get a 200 response with no results.
To Reproduce
With the client:
client = RESTClient(polygon_key)
types = client.get_ticker_types(asset_class="options", locale="us")
or with requests:
resp = requests.get(
url="https://api.polygon.io/v3/reference/tickers/types",
params={
"apiKey": polygon_key,
"asset_class": "options",
"locale": "us",
}
)
print(resp.status_code)
print(resp.json())
Expected behavior
I expected to receive the list of ticker types for options, analogously with how the endpoint works for stocks.
Observed behavior
Using the client I get:
TypeError: polygon.rest.models.tickers.TickerTypes() argument after ** must be a mapping, not NoneType
and with requests:
200
{'results': None, 'count': 0, 'status': 'OK', 'request_id': '14e8456dd17092c22d5d062f0c99434d'}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RESTClient.get_ticker_types(asset_class="options", locale="us") and compare its response handling with the /v3/reference/tickers/types request shown in the issue. Reproduce the None response and trace how it is passed to TickerTypes. Done means the options case is handled without a TypeError and returns the expected ticker types, with coverage for the empty or valid response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100