Skip to content

Client get_ticket_types() errors out on "options" asset class #907

@rz

Description

@rz

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'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions