Skip to content

Commit

Permalink
address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gnvk committed Sep 16, 2021
1 parent 00d7c01 commit 1c6618d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions alpaca_trade_api/rest.py
Expand Up @@ -546,7 +546,7 @@ def get_last_quote(self, symbol: str) -> Quote:

def _data_get(self,
endpoint: str,
symbol: Union[str, List[str]],
symbol_or_symbols: Union[str, List[str]],
api_version: str = 'v2',
endpoint_base: str = 'stocks',
**kwargs):
Expand All @@ -562,13 +562,13 @@ def _data_get(self,
data = kwargs
data['limit'] = actual_limit
data['page_token'] = page_token
if isinstance(symbol, str):
path = f'/{endpoint_base}/{symbol}/{endpoint}'
if isinstance(symbol_or_symbols, str):
path = f'/{endpoint_base}/{symbol_or_symbols}/{endpoint}'
else:
path = f'/{endpoint_base}/{endpoint}'
data['symbols'] = ','.join(symbol)
data['symbols'] = ','.join(symbol_or_symbols)
resp = self.data_get(path, data=data, api_version=api_version)
if isinstance(symbol, str):
if isinstance(symbol_or_symbols, str):
for item in resp.get(endpoint, []) or []:
yield item
total_items += 1
Expand Down

0 comments on commit 1c6618d

Please sign in to comment.