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

[Bug fix] - Handle multiple items with arbitrary type #6171

Merged
merged 11 commits into from
Mar 6, 2024

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Mar 6, 2024

  1. Why?

    • Multiple items only support str type
      • fields with type str is converted to Union[str, List[str]]
      • fields with type float/int should be converted to Union[float/int, List[float/int]]
  2. What?

    • Use List[<original_type>] instead of List[str]
    • Update obb.fixedincome.corporate.spot_rates accordingly
    • Fixes @handle_exceptions bug when original attribute is not present
    • Removes dangerous default [10.0] from maturity
    • Removes dangerous default ["spot_rate"] from category
    • Use comma separated string for both maturity and category
  3. Impact:

    • Arbitrary types allowed for multiple items
  4. Testing Done:

  • Run integration tests added in this PR

Also,

obb.fixedincome.corporate.spot_rates().to_df()
obb.fixedincome.corporate.spot_rates(maturity=["1", 5.5]).to_df()
obb.fixedincome.corporate.spot_rates(maturity="1,5.5").to_df()
obb.fixedincome.corporate.spot_rates(maturity=5.5).to_df()
obb.fixedincome.corporate.spot_rates(category="spot_rate").to_df()
obb.fixedincome.corporate.spot_rates(category="spot_rate,par_yield").to_df()

@github-actions github-actions bot added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels Mar 6, 2024
@montezdesousa montezdesousa added the tests Test-related work label Mar 6, 2024
@montezdesousa montezdesousa marked this pull request as ready for review March 6, 2024 17:32
@montezdesousa montezdesousa added this pull request to the merge queue Mar 6, 2024
Merged via the queue into develop with commit a8122e9 Mar 6, 2024
29 of 33 checks passed
@montezdesousa montezdesousa deleted the bugfix/multiple_items_type branch March 6, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug platform OpenBB Platform tests Test-related work v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants