mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Changes to the obb.fixedincome.corporate.hqm() output (#5876)
* changes to the hqm output * typo --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
This commit is contained in:
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -74,7 +74,7 @@
|
||||
- [ ] I have performed a self-review of my own code.
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas.
|
||||
- [ ] I have adhered to the GitFlow naming convention and my branch name is in the format of `feature/feature-name` or `hotfix/hotfix-name`.
|
||||
- [ ] I ensure that I am following th [CONTRIBUTING guidelines](https://github.com/OpenBB-finance/OpenBBTerminal/blob/main/CONTRIBUTING.md).
|
||||
- [ ] I ensure that I am following the [CONTRIBUTING guidelines](https://github.com/OpenBB-finance/OpenBBTerminal/blob/main/CONTRIBUTING.md).
|
||||
- [ ] (If applicable) I have updated tests following [these guidelines](/openbb_platform/CONTRIBUTING.md#qa-your-extension).
|
||||
|
||||
</details>
|
||||
|
||||
@@ -14,7 +14,7 @@ from openbb_fred.utils.fred_helpers import (
|
||||
YIELD_CURVE_SERIES_CORPORATE_PAR,
|
||||
YIELD_CURVE_SERIES_CORPORATE_SPOT,
|
||||
)
|
||||
from pydantic import field_validator
|
||||
from pydantic import Field, field_validator
|
||||
|
||||
|
||||
class FREDHighQualityMarketCorporateBondQueryParams(
|
||||
@@ -28,6 +28,8 @@ class FREDHighQualityMarketCorporateBondData(HighQualityMarketCorporateBondData)
|
||||
|
||||
__alias_dict__ = {"rate": "value"}
|
||||
|
||||
series_id: str = Field(description="FRED series id.")
|
||||
|
||||
@field_validator("rate", mode="before", check_fields=False)
|
||||
@classmethod
|
||||
def value_validate(cls, v):
|
||||
@@ -88,10 +90,15 @@ class FREDHighQualityMarketCorporateBondFetcher(
|
||||
start_date=start_date,
|
||||
**kwargs,
|
||||
)
|
||||
for item in d:
|
||||
item["maturity"] = maturity
|
||||
item["yield_curve"] = query.yield_curve
|
||||
data.extend(d)
|
||||
for observation in d:
|
||||
series_data = {
|
||||
"series_id": id_,
|
||||
"maturity": maturity,
|
||||
"yield_curve": query.yield_curve,
|
||||
"date": observation["date"],
|
||||
"value": observation["value"],
|
||||
}
|
||||
data.append(series_data)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user