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

Changes to the obb.fixedincome.corporate.hqm() output #5876

Merged
merged 4 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
17 changes: 12 additions & 5 deletions openbb_platform/providers/fred/openbb_fred/models/hqm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand Down
Loading