OpenBBTerminal
OpenBBTerminal copied to clipboard
[Feature] Optional choices
-
Why? (1-3 sentences or a bullet point list):
- There are some providers that allow custom choices other than the finite amount of choices other providers offer - in order not to limit usage, we need to be able to also use those custom choices. i.e., for those providers, the choices are merely a suggestion.
-
What? (1-3 sentences or a bullet point list):
-
Introduction of
optional_choices
attribute as a way of setting custom choices- this will still trigger auto-completion but set the
choices
of a given argument toNone
before parsing, allowing any value to be user - this is still fine because all providers are pydantic models and will perform their own validation
- this will still trigger auto-completion but set the
-
Took the opportunity to do some improvements in structure / refactoring, although nothing major, it improves readability.
-
-
Impact (1-2 sentences or a bullet point list):
- Usage and validation remains, as well as UX. Small enhancement since the users will not be able to query with custom values for those fields and providers.
-
Testing Done:
-
equity/price/historical --symbol aapl --provider polygon --interval 2h
equity/price/historical
fortmx
andpolygon
with theinterval
argument are the only place where this applies afaik. -
-
Reviewer Notes (optional):
- Please try different scenarios for other commands and providers and check if autocompleting and validation is still accurate.