alvarobartt / investiny

🤏🏻 `investpy` but made tiny
https://alvarobartt.github.io/investiny
MIT License
301 stars 36 forks source link

`exchange` param in `search_assets` has unexpected behaviour #37

Open alvarobartt opened 1 year ago

alvarobartt commented 1 year ago

Discussed in https://github.com/alvarobartt/investiny/discussions/33

Originally posted by **longlie1109** October 12, 2022 Is there a way to get the "exchange" in search_assets function ? NASDAQ works fine but other market isn't work out for me

So as the discussion says, it seems that the results provided by search_assets contain a field named exchange which doesn't seem to be matching the actual filter for the search, which means that if the results contain e.g. exchange="RANDOM_EXCHANGE", if you use that filter in a next call to search_assets using the exchange param, it won't work, as the printed exchange is not the same one as the one used by the filter, even though those refer to the same.

Note that something similar happens with the type parameter, which was already solved at https://github.com/alvarobartt/investiny/commit/8cf3e0eabc17e689975b63e8793b3fdab1b7fe34

alvarobartt commented 1 year ago

Related to #34