We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 55dfe43 + d9c6b0d commit 93af35aCopy full SHA for 93af35a
alpaca_trade_api/polygon/entity.py
@@ -93,7 +93,14 @@ def __init__(self, raw):
93
])
94
95
def _raw_results(self):
96
- return self._raw.get('results', [])
+ results = self._raw.get('results')
97
+ if not results:
98
+ # this is not very pythonic but it's written like this because
99
+ # the raw response for empty aggs was None, and this:
100
+ # self._raw.get('results', []) returns None, not [] which breaks
101
+ # when we try to iterate it.
102
+ return []
103
+ return results
104
105
def rename_keys(self):
106
colmap = {
0 commit comments