diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1c5145873d6a..3df72068a852 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -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). diff --git a/openbb_platform/providers/fred/openbb_fred/models/hqm.py b/openbb_platform/providers/fred/openbb_fred/models/hqm.py index b7c98ea836ef..c410b6d00803 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/hqm.py +++ b/openbb_platform/providers/fred/openbb_fred/models/hqm.py @@ -14,7 +14,7 @@ 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 @@ def extract_data( 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