Skip to content

_paginate_iter throws KeyError #467

@oboxer

Description

@oboxer

Describe the bug

_paginate_iter throws KeyError: 'results' when results doesn't exist in resp

To Reproduce

Call list_aggs with "/v2/aggs/ticker/O:SPY230703C00408000/range/5/minute/2023-07-03/2023-07-04"

Expected behavior

IMHO, this is not an error. When there's no results in resp, just skip it, don't throw a key error.
Change for t in decoded[result_key]: to for t in decoded.get(result_key, []): should be enough

Screenshots

N/A

Additional context

N/A

Metadata

Metadata

Assignees

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