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 FMP Market Snapshots #6160

Merged
merged 6 commits into from
Mar 4, 2024
Merged

Conversation

deeleeramone
Copy link
Contributor

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

    • Inconsistent types returned by FMP result in random validation errors.

    • 0 is returned instead of None in a field of Unix timestamps.

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

    • Added a bunch of validators to the FMP model to handle date parsing exceptions and clear all empty strings or NaN-like values.

    • substitute ForceInt in place of int.

    • "market" parameter made to accept lower case instead of ALL_CAPS

  3. Impact (1-2 sentences or a bullet point list):

    • Improved stability and standardization.

    • Changes affect only FMP.

    • Endpoint is not currently used by Pro

    • Applied json_schema_extra = {"x-unit_measurement": "percent", "x-frontend_multiply": 100} to FMP change_percent field.

    • "price" --> "last_price"

    • "avg_volume" --> "volume_avg"

    • "timestamp" --> "last_price_timestamp"

    • "market" parameter made to accept lower case instead of ALL_CAPS

  4. Testing Done:

    • Tested all choices to verify no validation errors were raised by surprise values.

Before:

OpenBBError: 1 validation error for FMPMarketSnapshots
avgVolume
  Input should be a valid integer, got a number with a fractional part [type=int_from_float, input_value=25443.3, input_type=float]

image

After:

Screenshot 2024-03-02 at 11 42 46 AM

Screenshot 2024-03-02 at 11 15 00 AM

@deeleeramone deeleeramone added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels Mar 2, 2024
@deeleeramone deeleeramone requested a review from IgorWounds March 4, 2024 18:23
@IgorWounds IgorWounds added this pull request to the merge queue Mar 4, 2024
Merged via the queue into develop with commit 47541d4 Mar 4, 2024
15 checks passed
@IgorWounds IgorWounds deleted the bugfix/fmp-market-snapshots branch March 7, 2024 12:43
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 v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants