Skip to content

Commit 7ea5800

Browse files
authored
deprecate us and eu yield_curve endpoints (#7026)
1 parent 13fc5f7 commit 7ea5800

File tree

15 files changed

+0
-228588
lines changed

15 files changed

+0
-228588
lines changed

openbb_platform/core/openbb_core/provider/standard_models/eu_yield_curve.py

-28
This file was deleted.

openbb_platform/core/openbb_core/provider/standard_models/us_yield_curve.py

-31
This file was deleted.

openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py

-45
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,6 @@ def test_fixedincome_government_treasury_rates(params, headers):
3939
assert result.status_code == 200
4040

4141

42-
@parametrize(
43-
"params",
44-
[({"date": "2023-01-01", "inflation_adjusted": True, "provider": "fred"})],
45-
)
46-
@pytest.mark.integration
47-
def test_fixedincome_government_us_yield_curve(params, headers):
48-
"""Test the US yield curve endpoint."""
49-
params = {p: v for p, v in params.items() if v}
50-
51-
query_str = get_querystring(params, [])
52-
url = (
53-
f"http://0.0.0.0:8000/api/v1/fixedincome/government/us_yield_curve?{query_str}"
54-
)
55-
result = requests.get(url, headers=headers, timeout=10)
56-
assert isinstance(result, requests.Response)
57-
assert result.status_code == 200
58-
59-
6042
@parametrize(
6143
"params",
6244
[
@@ -524,33 +506,6 @@ def test_fixedincome_spreads_treasury_effr(params, headers):
524506
assert result.status_code == 200
525507

526508

527-
@parametrize(
528-
"params",
529-
[
530-
(
531-
{
532-
"rating": "aaa",
533-
"provider": "ecb",
534-
"date": "2023-01-01",
535-
"yield_curve_type": "spot_rate",
536-
}
537-
),
538-
],
539-
)
540-
@pytest.mark.integration
541-
def test_fixedincome_government_eu_yield_curve(params, headers):
542-
"""Test the EU yield curve endpoint."""
543-
params = {p: v for p, v in params.items() if v}
544-
545-
query_str = get_querystring(params, [])
546-
url = (
547-
f"http://0.0.0.0:8000/api/v1/fixedincome/government/eu_yield_curve?{query_str}"
548-
)
549-
result = requests.get(url, headers=headers, timeout=30)
550-
assert isinstance(result, requests.Response)
551-
assert result.status_code == 200
552-
553-
554509
@parametrize(
555510
"params",
556511
[

openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py

-39
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,6 @@ def test_fixedincome_government_treasury_rates(params, obb):
3333
assert len(result.results) > 0
3434

3535

36-
@parametrize(
37-
"params",
38-
[
39-
({"date": "2023-01-01", "inflation_adjusted": True, "provider": "fred"}),
40-
],
41-
)
42-
@pytest.mark.integration
43-
def test_fixedincome_government_us_yield_curve(params, obb):
44-
"""Test the US yield curve endpoint."""
45-
result = obb.fixedincome.government.us_yield_curve(**params)
46-
assert result
47-
assert isinstance(result, OBBject)
48-
assert len(result.results) > 0
49-
50-
5136
@parametrize(
5237
"params",
5338
[
@@ -484,30 +469,6 @@ def test_fixedincome_spreads_treasury_effr(params, obb):
484469
assert len(result.results) > 0
485470

486471

487-
@parametrize(
488-
"params",
489-
[
490-
(
491-
{
492-
"rating": "aaa",
493-
"provider": "ecb",
494-
"date": "2023-01-01",
495-
"yield_curve_type": "spot_rate",
496-
}
497-
),
498-
],
499-
)
500-
@pytest.mark.integration
501-
def test_fixedincome_government_eu_yield_curve(params, obb):
502-
"""Test the EU yield curve endpoint."""
503-
params = {p: v for p, v in params.items() if v}
504-
505-
result = obb.fixedincome.government.eu_yield_curve(**params)
506-
assert result
507-
assert isinstance(result, OBBject)
508-
assert len(result.results) > 0
509-
510-
511472
@parametrize(
512473
"params",
513474
[

openbb_platform/extensions/fixedincome/openbb_fixedincome/government/government_router.py

-66
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Fixed Income Government Router."""
22

3-
from openbb_core.app.deprecation import OpenBBDeprecationWarning
43
from openbb_core.app.model.command_context import CommandContext
54
from openbb_core.app.model.example import APIEx
65
from openbb_core.app.model.obbject import OBBject
@@ -49,71 +48,6 @@ async def yield_curve(
4948
return await OBBject.from_query(Query(**locals()))
5049

5150

52-
@router.command(
53-
model="USYieldCurve",
54-
deprecated=True,
55-
deprecation=OpenBBDeprecationWarning(
56-
message="This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead.",
57-
since=(4, 2),
58-
expected_removal=(4, 4),
59-
),
60-
examples=[
61-
APIEx(parameters={"provider": "fred"}),
62-
APIEx(parameters={"inflation_adjusted": True, "provider": "fred"}),
63-
],
64-
)
65-
async def us_yield_curve(
66-
cc: CommandContext,
67-
provider_choices: ProviderChoices,
68-
standard_params: StandardParams,
69-
extra_params: ExtraParams,
70-
) -> OBBject: # type: ignore
71-
"""US Yield Curve. Get United States yield curve."""
72-
return await OBBject.from_query(Query(**locals()))
73-
74-
75-
@router.command(
76-
model="EUYieldCurve",
77-
deprecated=True,
78-
deprecation=OpenBBDeprecationWarning(
79-
message="This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead.",
80-
since=(4, 2),
81-
expected_removal=(4, 4),
82-
),
83-
examples=[
84-
APIEx(parameters={"provider": "ecb"}),
85-
APIEx(parameters={"yield_curve_type": "spot_rate", "provider": "ecb"}),
86-
],
87-
)
88-
async def eu_yield_curve(
89-
cc: CommandContext,
90-
provider_choices: ProviderChoices,
91-
standard_params: StandardParams,
92-
extra_params: ExtraParams,
93-
) -> OBBject:
94-
"""Euro Area Yield Curve.
95-
96-
Gets euro area yield curve data from ECB.
97-
98-
The graphic depiction of the relationship between the yield on bonds of the same credit quality but different
99-
maturities is known as the yield curve. In the past, most market participants have constructed yield curves from
100-
the observations of prices and yields in the Treasury market. Two reasons account for this tendency. First,
101-
Treasury securities are viewed as free of default risk, and differences in creditworthiness do not affect yield
102-
estimates. Second, as the most active bond market, the Treasury market offers the fewest problems of illiquidity
103-
or infrequent trading. The key function of the Treasury yield curve is to serve as a benchmark for pricing bonds
104-
and setting yields in other sectors of the debt market.
105-
106-
It is clear that the market’s expectations of future rate changes are one important determinant of the
107-
yield-curve shape. For example, a steeply upward-sloping curve may indicate market expectations of near-term Fed
108-
tightening or of rising inflation. However, it may be too restrictive to assume that the yield differences across
109-
bonds with different maturities only reflect the market’s rate expectations. The well-known pure expectations
110-
hypothesis has such an extreme implication. The pure expectations hypothesis asserts that all government bonds
111-
have the same near-term expected return (as the nominally riskless short-term bond) because the return-seeking
112-
activity of risk-neutral traders removes all expected return differentials across bonds.
113-
"""
114-
return await OBBject.from_query(Query(**locals()))
115-
116-
11751
@router.command(
11852
model="TreasuryRates",
11953
examples=[APIEx(parameters={"provider": "fmp"})],

openbb_platform/providers/ecb/openbb_ecb/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from openbb_core.provider.abstract.provider import Provider
44
from openbb_ecb.models.balance_of_payments import ECBBalanceOfPaymentsFetcher
55
from openbb_ecb.models.currency_reference_rates import ECBCurrencyReferenceRatesFetcher
6-
from openbb_ecb.models.eu_yield_curve import ECBEUYieldCurveFetcher
76
from openbb_ecb.models.yield_curve import ECBYieldCurveFetcher
87

98
ecb_provider = Provider(
@@ -15,7 +14,6 @@
1514
fetcher_dict={
1615
"BalanceOfPayments": ECBBalanceOfPaymentsFetcher,
1716
"CurrencyReferenceRates": ECBCurrencyReferenceRatesFetcher,
18-
"EUYieldCurve": ECBEUYieldCurveFetcher,
1917
"YieldCurve": ECBYieldCurveFetcher,
2018
},
2119
repr_name="European Central Bank (ECB)",

0 commit comments

Comments
 (0)