-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search_quotes returns unconsistent type #339
Comments
Hi @tavasti, thank you too for reporting the issues! 🔥 Indeed I included an option so that whenever the parameter Thank you for reporting this too! |
P.S.: As a quick fix you can just result = results[0] if isinstance(results, list) else results |
Yeah, that is what I did, but still wanted to report this because most likely there will be other people who hit the same. |
Hi again @tavasti I'll be fixing this so that it just returns a single value if |
Yeah, that sounds correct! |
Hi @tavasti this has already been solved! 🔥 So the current behaviour is: >>> import investpy
>>> data = investpy.search_quotes('LU0486851024',products=["etfs"],countries=["germany"])
>>> data
[<investpy.utils.search_obj.SearchObj object at 0x7fd8e28d53d0>]
>>> data = investpy.search_quotes('LU0486851024',products=["etfs"],countries=["germany"], n_results=1)
>>> data
<investpy.utils.search_obj.SearchObj object at 0x7fd8e28d5370> This will be available in the next release |
Hi @tavasti, the new release is already out! 🔥 You can already install it using either For more information about this new release, you should check investpy v1.0.7 Release 🎈 |
Thanks for fixing search_quotes back to live quickly!
However, there is one more thing in it:
search_quotes returns list when getting multiple entries, but single object when there is only one:
Should it return list in any case?
The text was updated successfully, but these errors were encountered: