Skip to content

Commit

Permalink
revert and handle non list string iterables
Browse files Browse the repository at this point in the history
  • Loading branch information
ccnlui committed Jan 13, 2022
1 parent 1c466cf commit 4621731
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions alpaca_trade_api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def _data_get(self,
path += f'/{symbol_or_symbols}'
if endpoint:
path += f'/{endpoint}'
if isinstance(symbol_or_symbols, list) and symbol_or_symbols:
if not isinstance(symbol_or_symbols, str):
data['symbols'] = ','.join(symbol_or_symbols)
resp = self.data_get(path, data=data, api_version=api_version)
if not resp_grouped_by_symbol:
Expand Down Expand Up @@ -914,7 +914,6 @@ def get_news_iter(self,
include_content: bool = False,
exclude_contentless: bool = False,
raw=False) -> NewsIterator:
symbol = symbol or []
# Avoid passing symbol as path param
if isinstance(symbol, str):
symbol = [symbol]
Expand Down

0 comments on commit 4621731

Please sign in to comment.