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] Fix Currency Search #6380

Merged
merged 3 commits into from
May 9, 2024
Merged

[BugFix] Fix Currency Search #6380

merged 3 commits into from
May 9, 2024

Conversation

deeleeramone
Copy link
Contributor

  1. Why?:

    • This command has 3 different providers but then it doesn’t have any standard argument and all the available provider arguments belong to polygon only.
  2. What?:

    • There is now one parameter, "query", and it is valid for all 3 providers.
  3. Impact:

    • This endpoint is pretty unlikely to be used, is for generating lists of valid symbols for a source, and a basic text search through every field returned is all its capable of.
  4. Testing Done:

    • Updated integration tests and Polygon unit test.
obb.currency.search("euro", provider="polygon")
OBBject

id: 0663c5e6-9a47-7b78-8000-84fc8542c7a8
results: [{'symbol': 'AEDEUR', 'name': 'Euro', 'currency_symbol': 'EUR', 'base_curr...
provider: polygon
warnings: None
chart: None
extra: {'metadata': {'arguments': {'provider_choices': {'provider': 'polygon'}, 'st...
obb.currency.search("europe", provider="polygon")
Detail -> No results were found with the query supplied. -> europe
obb.currency.search("europe", provider="fmp")
OpenBBError: 
Type -> EmptyDataError

Detail -> No results were found with the query supplied. -> europe Hint: Names and descriptions are not searchable from FMP, try 3-letter symbols.

@deeleeramone deeleeramone added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels May 9, 2024
@IgorWounds IgorWounds added this pull request to the merge queue May 9, 2024
Merged via the queue into develop with commit 4d6074d May 9, 2024
10 checks passed
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 well for all providers. I believe having the "query" facilitates understanding how the command works, nice!

@@ -22,75 +25,39 @@ class PolygonCurrencyPairsQueryParams(CurrencyPairsQueryParams):
Source: https://polygon.io/docs/forex/get_v3_reference_tickers
"""

symbol: Optional[str] = Field(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why removing this Polygon query parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we can do everything post-request with no real impact on performance while making it operate like everything else and simplifying it dramatically for the end-user.

@IgorWounds IgorWounds deleted the bugfix/currency-search branch May 9, 2024 10:01
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.

3 participants