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

未关闭
#907 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

从 RESTClient.get_ticker_types(asset_class="options", locale="us") 开始,并将其响应处理方式与 issue 中所示的 /v3/reference/tickers/types 请求进行比较。重现 None 响应,并跟踪它如何传递给 TickerTypes。完成的标准是 options 情况能够在不产生 TypeError 的情况下得到处理并返回预期的 ticker types,同时覆盖空响应或有效响应。

由索引模型根据 Issue 内容生成。

描述

bug

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'}
主要语言
Python
星标
1.5k
派生
362
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

massive-com/client-python 的其他 Issue

查看 massive-com/client-python 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。