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] Chunk FMP Price Performance URL For Large Lists #6317

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

deeleeramone
Copy link
Contributor

@deeleeramone deeleeramone commented Apr 16, 2024

  1. Why?:

    • For the endpoint: obb.equity.price.performance(provider="fmp") the URL string could be too long when passed a large list of symbols.
  2. What? (1-3 sentences or a bullet point list):

    • This PR chunks the URL into groups of 200 symbols.
    • Add to_upper() validator for the symbol parameter of obb.etf.holdings().
    • Clear "-" as a symbol from FMP response of ETF holdings, replacing with None.
  3. Impact (1-2 sentences or a bullet point list):

    • Large lists of symbols can be passed to the endpoint, with FMP as the provider.
    • Upper case symbols are not required for ETF Holdings any more.
    • Deprecate obb.etf.holdings_performance() in favour of making the user define the list of symbols themselves and use equity.price.performance() instead.
  4. Testing Done:

The the list of holdings tickers in IWM as the list, it creates an error.

Before:

ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL...

Where the root error code is: 414 Request-URI Too Large

After:

Screenshot 2024-04-16 at 12 35 28 PM

@deeleeramone deeleeramone added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels Apr 16, 2024
@IgorWounds IgorWounds added this pull request to the merge queue Apr 17, 2024
Merged via the queue into develop with commit 510b938 Apr 17, 2024
10 checks passed
@IgorWounds IgorWounds deleted the bugfix/fmp-url-chunk branch April 22, 2024 18:07
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