OpenBBTerminal icon indicating copy to clipboard operation
OpenBBTerminal copied to clipboard

[Feature] Optional choices

Open hjoaquim opened this issue 1 month ago • 7 comments

  1. 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.
  2. 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 to None before parsing, allowing any value to be user
      • this is still fine because all providers are pydantic models and will perform their own validation
    • Took the opportunity to do some improvements in structure / refactoring, although nothing major, it improves readability.

  3. 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.
  4. Testing Done:

    • equity/price/historical --symbol aapl --provider polygon --interval 2h

    equity/price/historical for tmx and polygon with the interval argument are the only place where this applies afaik.

  5. Reviewer Notes (optional):

    • Please try different scenarios for other commands and providers and check if autocompleting and validation is still accurate.

hjoaquim avatar May 24 '24 15:05 hjoaquim