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

Đang mở
#907 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với RESTClient.get_ticker_types(asset_class="options", locale="us") và so sánh cách xử lý response của nó với request /v3/reference/tickers/types được nêu trong issue. Tái hiện response None và theo dõi cách nó được truyền vào TickerTypes. Hoàn thành khi trường hợp options được xử lý mà không gặp TypeError và trả về các ticker type như mong đợi, với coverage cho response rỗng hoặc hợp lệ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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'}
Ngôn ngữ chính
Python
Star
1.5k
Fork
362
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của massive-com/client-python

Tất cả issue của massive-com/client-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.