massive-com / massive-com/client-python

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

Aperta
#907 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Python
Stelle
1.5k
Fork
362
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con RESTClient.get_ticker_types(asset_class="options", locale="us") e confronta la gestione della relativa risposta con quella della richiesta /v3/reference/tickers/types mostrata nell’issue. Riproduci la risposta None e traccia come viene passata a TickerTypes. Il lavoro è completato quando il caso options viene gestito senza un TypeError e restituisce i tipi di ticker attesi, con una copertura per una risposta vuota o valida.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.