[BugFix] Fix FMP Market Snapshots #6160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 ofint
."market" parameter made to accept lower case instead of ALL_CAPS
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 FMPchange_percent
field."price" --> "last_price"
"avg_volume" --> "volume_avg"
"timestamp" --> "last_price_timestamp"
"market" parameter made to accept lower case instead of ALL_CAPS
Testing Done:
Before:
After: