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

[BugFix] - multiple items allowed in provider parameters #6256

Merged
merged 5 commits into from
Mar 28, 2024

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Mar 26, 2024

Why?

  • Provider parameters that allow multiple items are ignored by the package builder
  1. What?

    • Renames parameter extra_info to info
    • Send extra_params information to filter_inputs
    • Apply this to analyst_search
    • Be more specific on how multiple items can be passed (comma separated)
    • Raises exceptions in the API if we are in debug mode, which will log the traceback instead of just a message like None is not iterable
  2. Impact

    • We can now specify
    __json_schema_extra__ = {
        "analyst_name": ["multiple_items_allowed"], # standard
        "firm_name": ["multiple_items_allowed"], # standard
        "analyst_ids": ["multiple_items_allowed"], # extra
        "firm_ids": ["multiple_items_allowed"], # extra
        "fields": ["multiple_items_allowed"], # extra
    }

Translates into

              ...,
              info={
                  "analyst_name": {"multiple_items_allowed": ["benzinga"]},
                  "firm_name": {"multiple_items_allowed": ["benzinga"]},
                  "analyst_ids": {"multiple_items_allowed": ["benzinga"]},
                  "firm_ids": {"multiple_items_allowed": ["benzinga"]},
                  "fields": {"multiple_items_allowed": ["benzinga"]},
              },
          )
      )
  1. Testing Done:
obb.equity.estimates.analyst_search(
    firm_ids=["6065cc39a93f970001f2c9aa"],
    analyst_ids=["59d376ec6ab1240001daf923", "5e4e5bfeece4e600011f5821"],
    ).to_df()

@montezdesousa montezdesousa changed the title [BugFix] - fix extra multiple items in extra parameters [BugFix] - multiple items allowed in extra parameters Mar 26, 2024
@github-actions github-actions bot added bug Fix bug platform OpenBB Platform v4 PRs for v4 breaking_change labels Mar 26, 2024
@montezdesousa montezdesousa changed the title [BugFix] - multiple items allowed in extra parameters [BugFix] - multiple items allowed in provider parameters Mar 26, 2024
@montezdesousa montezdesousa requested a review from hjoaquim March 27, 2024 12:11
Copy link
Contributor

@hjoaquim hjoaquim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm.

@hjoaquim hjoaquim added this pull request to the merge queue Mar 28, 2024
Merged via the queue into develop with commit db9960a Mar 28, 2024
10 checks passed
@IgorWounds IgorWounds deleted the bugfix/multiple_items_extra branch April 9, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change bug Fix bug platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants