Skip to content
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

[Feature] Handle repeated non standard arguments #6366

Merged
merged 9 commits into from
May 7, 2024

Conversation

hjoaquim
Copy link
Contributor

@hjoaquim hjoaquim commented May 6, 2024

  1. Why? (1-3 sentences or a bullet point list):

    • Need to properly handle repeated (used in more than one provider) non-standard arguments - which Argparse can't handle out-of-the-box since it doesn't allow arguments with the same name.
  2. What? (1-3 sentences or a bullet point list):

    • Check if the argument already exists, if not add it to the provider group. If the argument exists, check if it's a standard already and don't add it to any other group; if it's not a standard, remove it from previously added groups and add it to the standard instead.
    • If the choices differ, update them to accommodate all the available options and let the Platform handle the errors.
    • Update the help message with the available providers.
  3. Impact (1-2 sentences or a bullet point list):

    • NA

better usability since it removes a "bug" where the user was only able to use a given repeated non standard argument for one provider.

  1. Testing Done:

    • Any Platform command where this happens, eg: the adjustment arg on /equity/price/historical
  2. Reviewer Notes (optional):

    • NA
  3. Any other information (optional)

Before

image

only available for one provider

After

image

available in the optional arguments so it can be used with multiple providers, also with all the available choices and with specifying the available providers in the help message

@hjoaquim hjoaquim added the cli OpenBB Platform CLI label May 6, 2024
@hjoaquim hjoaquim requested a review from montezdesousa May 6, 2024 13:23
@github-actions github-actions bot added enhancement Enhancement labels May 6, 2024
@hjoaquim hjoaquim requested a review from IgorWounds May 7, 2024 08:30
@hjoaquim hjoaquim enabled auto-merge May 7, 2024 13:56
@hjoaquim hjoaquim added this pull request to the merge queue May 7, 2024
Merged via the queue into develop with commit 756eebd May 7, 2024
7 checks passed
@IgorWounds IgorWounds deleted the feature/handle-repeated-args branch May 9, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli OpenBB Platform CLI enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants