Skip to content

Commit

Permalink
[Feature] Deprecate etf.holdings_performance endpoint (#6441)
Browse files Browse the repository at this point in the history
* ignore the env created on the dev container (which lives inside the project folder)

* broken urls

* remove endpoint

* empty file

* deprecate

* ruff
  • Loading branch information
hjoaquim authored May 20, 2024
1 parent 6fd00e7 commit e292237
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 488 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ cli/openbb_cli/assets/styles/user/hub.richstyle.json

# Platform
openbb_platform/openbb/package/*

# Dev Container env
obb/*
4 changes: 2 additions & 2 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The OpenBB Platform CLI is a command line interface that wraps [OpenBB Platform]

It offers a convenient way to interact with the OpenBB Platform and its extensions, as well as automate data collection via OpenBB Routine Scripts.

Find the most complete documentation, examples, and usage guides for the OpenBB Platform CLI [here](https://my.openbb.co/app/cli).
Find the most complete documentation, examples, and usage guides for the OpenBB Platform CLI [here](https://docs.openbb.co/cli).

## Installation

Expand All @@ -24,7 +24,7 @@ The command below provides access to the all the available OpenBB extensions beh
pip install openbb-cli
```

> Note: Find the most complete installation hints and tips [here](https://my.openbb.co/app/cli/installation).
> Note: Find the most complete installation hints and tips [here](https://docs.openbb.co/cli/installation).
After the installation is complete, you can deploy the OpenBB Platform CLI by running the following command:

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion openbb_platform/core/tests/app/test_charting_manager.py

This file was deleted.

4 changes: 0 additions & 4 deletions openbb_platform/core/tests/app/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@

import unittest

import pytest
from openbb_core.app.static.package_builder import PathHandler
from openbb_core.app.version import VERSION, get_major_minor


class DeprecatedCommandsTest(unittest.TestCase):
"""Test deprecated commands."""

@pytest.mark.skip(
"We forgot to deprecate /etf/holdings_performance. Check this endpoint next release."
)
def test_deprecated_commands(self):
"""Test deprecated commands."""
current_major_minor = get_major_minor(VERSION)
Expand Down
19 changes: 0 additions & 19 deletions openbb_platform/extensions/etf/integration/test_etf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,25 +463,6 @@ def test_etf_discovery_active(params, headers):
assert result.status_code == 200


@parametrize(
"params",
[
({"symbol": "SPY", "provider": "fmp"}),
({"symbol": "QQQ", "provider": "fmp"}),
],
)
@pytest.mark.integration
def test_etf_holdings_performance(params, headers):
"""Test the ETF holdings performance endpoint."""
params = {p: v for p, v in params.items() if v}

query_str = get_querystring(params, [])
url = f"http://0.0.0.0:8000/api/v1/etf/holdings_performance?{query_str}"
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200


@parametrize(
"params",
[
Expand Down
18 changes: 0 additions & 18 deletions openbb_platform/extensions/etf/integration/test_etf_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,24 +446,6 @@ def test_etf_discovery_active(params, obb):
assert len(result.results) > 0


@parametrize(
"params",
[
({"symbol": "SPY", "provider": "fmp"}),
({"symbol": "QQQ", "provider": "fmp"}),
],
)
@pytest.mark.integration
def test_etf_holdings_performance(params, obb):
"""Test the ETF holdings performance endpoint."""
params = {p: v for p, v in params.items() if v}

result = obb.etf.holdings_performance(**params)
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0


@parametrize(
"params",
[
Expand Down
22 changes: 0 additions & 22 deletions openbb_platform/extensions/etf/openbb_etf/etf_router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""ETF Router."""

from openbb_core.app.deprecation import OpenBBDeprecationWarning
from openbb_core.app.model.command_context import CommandContext
from openbb_core.app.model.example import APIEx
from openbb_core.app.model.obbject import OBBject
Expand Down Expand Up @@ -171,27 +170,6 @@ async def holdings_date(
return await OBBject.from_query(Query(**locals()))


@router.command(
model="EtfHoldingsPerformance",
deprecated=True,
deprecation=OpenBBDeprecationWarning(
message="This endpoint is deprecated; pass a list of holdings symbols directly to"
+ " `/equity/price/performance` instead.",
since=(4, 1),
expected_removal=(4, 2),
),
examples=[APIEx(parameters={"symbol": "XLK", "provider": "fmp"})],
)
async def holdings_performance(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject:
"""Get the recent price performance of each ticker held in the ETF."""
return await OBBject.from_query(Query(**locals()))


@router.command(
model="EtfEquityExposure",
examples=[
Expand Down
2 changes: 0 additions & 2 deletions openbb_platform/providers/fmp/openbb_fmp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from openbb_fmp.models.etf_equity_exposure import FMPEtfEquityExposureFetcher
from openbb_fmp.models.etf_holdings import FMPEtfHoldingsFetcher
from openbb_fmp.models.etf_holdings_date import FMPEtfHoldingsDateFetcher
from openbb_fmp.models.etf_holdings_performance import FMPEtfHoldingsPerformanceFetcher
from openbb_fmp.models.etf_info import FMPEtfInfoFetcher
from openbb_fmp.models.etf_search import FMPEtfSearchFetcher
from openbb_fmp.models.etf_sectors import FMPEtfSectorsFetcher
Expand Down Expand Up @@ -102,7 +101,6 @@
"EtfEquityExposure": FMPEtfEquityExposureFetcher,
"EtfHoldings": FMPEtfHoldingsFetcher,
"EtfHoldingsDate": FMPEtfHoldingsDateFetcher,
"EtfHoldingsPerformance": FMPEtfHoldingsPerformanceFetcher,
"EtfInfo": FMPEtfInfoFetcher,
"EtfPricePerformance": FMPPricePerformanceFetcher,
"EtfSearch": FMPEtfSearchFetcher,
Expand Down

This file was deleted.

Loading

0 comments on commit e292237

Please sign in to comment.