diff options
author | Henrique Joaquim <h.joaquim@campus.fct.unl.pt> | 2024-02-05 13:01:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 13:01:50 +0000 |
commit | 743c229f3a7dc69ae379a00584bce2e058c5f6ae (patch) | |
tree | 6235f87f640d6bce62fff39a9bf7c0053a4a35c5 | |
parent | 52ac1758f3463cc7523303f614fad7b51029b68f (diff) |
[BugFix] - Improve Standardization - `IndexHistorical` (#6030)
* format w new black
* Revert "format w new black"
This reverts commit 74b9619cc6b565f85aef1e89fc01900b86c8b991.
* small adjustment on the test
* index historical
* adjust tests accordingly
* keep the test skipped
* match tests w python
* fix tests
* keep the skip
* fix test
11 files changed, 159 insertions, 123 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py b/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py index 1443562936b..a92cebef681 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/index_historical.py @@ -4,10 +4,10 @@ from datetime import ( date as dateType, datetime, ) -from typing import List, Optional, Set, Union +from typing import List, Literal, Optional, Set, Union from dateutil import parser -from pydantic import Field, StrictFloat, field_validator +from pydantic import Field, PositiveInt, StrictFloat, field_validator from openbb_core.provider.abstract.data import Data, ForceInt from openbb_core.provider.abstract.query_params import QueryParams @@ -27,6 +27,18 @@ class IndexHistoricalQueryParams(QueryParams): end_date: Optional[dateType] = Field( description=QUERY_DESCRIPTIONS.get("end_date", ""), default=None ) + interval: Optional[str] = Field( + default="1d", + description=QUERY_DESCRIPTIONS.get("interval", ""), + ) + limit: Optional[PositiveInt] = Field( + default=10000, + description=QUERY_DESCRIPTIONS.get("limit", ""), + ) + sort: Optional[Literal["asc", "desc"]] = Field( + default="asc", + description="Sort the data in ascending or descending order.", + ) @field_validator("symbol", mode="before", check_fields=False) @classmethod diff --git a/openbb_platform/extensions/index/integration/test_index_api.py b/openbb_platform/extensions/index/integration/test_index_api.py index 3b7fa9c7be4..9b811f561c1 100644 --- a/openbb_platform/extensions/index/integration/test_index_api.py +++ b/openbb_platform/extensions/index/integration/test_index_api.py @@ -42,21 +42,14 @@ def test_index_constituents(params, headers): [ ( { - "symbol": "^DJI", - "start_date": "2023-01-01", - "end_date": "2023-06-06", - "provider": "fmp", - "sort": "desc", - } - ), - ( - { "interval": "1m", "provider": "cboe", "symbol": "AAVE100", - "start_date": "2023-01-01", - "end_date": "2023-06-06", + "start_date": "2024-01-01", + "end_date": "2024-02-05", "use_cache": False, + "sort": None, + "limit": None, } ), ( @@ -67,6 +60,8 @@ def test_index_constituents(params, headers): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": False, + "sort": None, + "limit": None, } ), ( @@ -74,10 +69,11 @@ def test_index_constituents(params, headers): "interval": "1min", "provider": "fmp", "symbol": "^DJI", - "start_date": "2023-01-01", - "end_date": "2023-06-06", + "start_date": "2024-01-01", + "end_date": "2024-02-05", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -89,6 +85,7 @@ def test_index_constituents(params, headers): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -102,6 +99,7 @@ def test_index_constituents(params, headers): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -115,6 +113,7 @@ def test_index_constituents(params, headers): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -127,10 +126,13 @@ def test_index_constituents(params, headers): "symbol": "DJI", "start_date": "2023-01-01", "end_date": "2023-06-06", + "sort": None, + "limit": None, } ), ( { + "interval": "1d", "provider": "intrinio", "start_date": "2023-01-01", "end_date": "2023-06-06", @@ -162,6 +164,8 @@ def test_index_price_historical(params, headers): "end_date": "2023-06-06", "provider": "fmp", "sort": "desc", + "interval": None, + "limit": None, } ), ( @@ -172,6 +176,8 @@ def test_index_price_historical(params, headers): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": True, + "limit": None, + "sort": None, } ), ( @@ -182,6 +188,8 @@ def test_index_price_historical(params, headers): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": False, + "limit": None, + "sort": None, } ), ( @@ -193,6 +201,7 @@ def test_index_price_historical(params, headers): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -204,6 +213,7 @@ def test_index_price_historical(params, headers): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -217,6 +227,7 @@ def test_index_price_historical(params, headers): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -230,6 +241,7 @@ def test_index_price_historical(params, headers): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -242,6 +254,8 @@ def test_index_price_historical(params, headers): "symbol": "DJI", "start_date": "2023-01-01", "end_date": "2023-06-06", + "limit": None, + "sort": None, } ), ( @@ -254,6 +268,7 @@ def test_index_price_historical(params, headers): "sort": "desc", "limit": 100, "type": None, + "interval": None, } ), ], diff --git a/openbb_platform/extensions/index/integration/test_index_python.py b/openbb_platform/extensions/index/integration/test_index_python.py index 7e5787518c7..30e4631dbc6 100644 --- a/openbb_platform/extensions/index/integration/test_index_python.py +++ b/openbb_platform/extensions/index/integration/test_index_python.py @@ -41,9 +41,11 @@ def test_index_constituents(params, obb): "interval": "1m", "provider": "cboe", "symbol": "AAVE100", - "start_date": "2023-01-01", - "end_date": "2023-06-06", + "start_date": "2024-01-01", + "end_date": "2024-02-05", "use_cache": False, + "sort": None, + "limit": None, } ), ( @@ -54,6 +56,8 @@ def test_index_constituents(params, obb): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": False, + "sort": None, + "limit": None, } ), ( @@ -61,10 +65,11 @@ def test_index_constituents(params, obb): "interval": "1min", "provider": "fmp", "symbol": "^DJI", - "start_date": "2023-01-01", - "end_date": "2023-06-06", + "start_date": "2024-01-01", + "end_date": "2024-02-05", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -76,6 +81,7 @@ def test_index_constituents(params, obb): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -89,6 +95,7 @@ def test_index_constituents(params, obb): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -102,6 +109,7 @@ def test_index_constituents(params, obb): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -114,10 +122,13 @@ def test_index_constituents(params, obb): "symbol": "DJI", "start_date": "2023-01-01", "end_date": "2023-06-06", + "sort": None, + "limit": None, } ), ( { + "interval": "1d", "provider": "intrinio", "start_date": "2023-01-01", "end_date": "2023-06-06", @@ -141,9 +152,13 @@ def test_index_price_historical(params, obb): [ ( { - "symbol": "AAVE100", + "symbol": "^DJI", "start_date": "2023-01-01", "end_date": "2023-06-06", + "provider": "fmp", + "sort": "desc", + "interval": None, + "limit": None, } ), ( @@ -154,6 +169,8 @@ def test_index_price_historical(params, obb): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": True, + "limit": None, + "sort": None, } ), ( @@ -164,6 +181,8 @@ def test_index_price_historical(params, obb): "start_date": "2023-01-01", "end_date": "2023-06-06", "use_cache": False, + "limit": None, + "sort": None, } ), ( @@ -175,6 +194,7 @@ def test_index_price_historical(params, obb): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -186,6 +206,7 @@ def test_index_price_historical(params, obb): "end_date": "2023-06-06", "timeseries": 1, "sort": "desc", + "limit": None, } ), ( @@ -199,6 +220,7 @@ def test_index_price_historical(params, obb): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -212,6 +234,7 @@ def test_index_price_historical(params, obb): "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", + "interval": None, } ), ( @@ -224,6 +247,8 @@ def test_index_price_historical(params, obb): "symbol": "DJI", "start_date": "2023-01-01", "end_date": "2023-06-06", + "limit": None, + "sort": None, } ), ( @@ -236,6 +261,7 @@ def test_index_price_historical(params, obb): "sort": "desc", "limit": 100, "type": None, + "interval": None, } ), ], diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py index d3b2210c119..eb0731f3bc0 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py @@ -12,7 +12,7 @@ from openbb_core.provider.standard_models.index_historical import ( from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_core.provider.utils.helpers import get_querystring from openbb_fmp.utils.helpers import get_data_many -from pydantic import Field, NonNegativeInt +from pydantic import Field, NonNegativeInt, validator class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): @@ -29,9 +29,12 @@ class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): interval: Literal["1min", "5min", "15min", "30min", "1hour", "4hour", "1day"] = ( Field(default="1day", description="Data granularity.") ) - sort: Literal["asc", "desc"] = Field( - default="desc", description="Sort the data in ascending or descending order." - ) + + @validator("interval") + @classmethod + def map_interval(cls, v): + """Map the interval from standard to the FMP format.""" + return "1day" if v == "1d" else v class FMPIndexHistoricalData(IndexHistoricalData): diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml index a69a35e3d59..e174458b9f3 100644 --- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_index_historical_fetcher.yaml @@ -9,16 +9,16 @@ interactions: Connection: - keep-alive method: GET - uri: https://financialmodelingprep.com/api/v3/historical-chart/1day/%5EDJI?apikey=MOCK_API_KEY&from=2023-01-01&to=2023-01-10 + uri: https://financialmodelingprep.com/api/v3/historical-chart/1day/%5EDJI?apikey=MOCK_API_KEY&from=2023-01-01&limit=10000&to=2023-01-10 response: body: string: !!binary | - H4sIAAAAAAAAA43SS07DMBAG4H1PEWXdjubhGXt6FcQCQUSRCkHitUDcHTcNcesopVGShX9b/jye - m1XTfOevadqHu/eu3TYtI8sGaUPYEG8R89uuj1P61+4lTxFRMgjs5mOw77+G8cAECTGmcXz39Lgb - gsgGKo42Bvf7/q07JhiAkPQv+ez3H8+HiC2xYX7y+M962Ym+7DQLcNiVa2eKYIZktdNFs8YlzZxK - eUlIIdRO4ZjCNU5bdqIqyEndRie7xzN/qSfh2QGK0yQnJycoTsN4lVOXneQEkVLUypmIYfjXznrB - 5GTPznzgaUlxSnS+xhkuOC1fY5jfO4pASBhi7QzoZ11Y6snmEM1VZs7oQzn/dcoFZ0iQvDTVVE9F - 0IhCtVNy4yoVTXGSGBzawmdO1Vzr0bm6/QU7Pyuq8gMAAA== + H4sIAAAAAAAAA43SzU6DQBAH8HufgnBuJ/O9O30V48FoY02qmPh1ML67CyWFgtQS4MB/N/ubYW5W + VfVdnqqqH+7ed/W2qhlZNkgbwgpx2931+riked29lCUiRg7K4Tn3yaH56gJlgoyYMvXB/ulx3yWJ + HUwCXfrk/tC87Y4RKhCSnaLP5vDx3GbsmR3LVb7/rJetGMtWd4X2XLapNSdwb8+dWkOsgEKSzaxG + ZZNmlTy1Cqes11h92YpmIOP29VaOSOdFDH0lPK9isLqUaFzGYHVMV1lt2UpBkCinSVs5E0P3nlGn + O05SjiJtq+a5VFLwNVK9IPXyO/WPCUAR0IzqMaUqxvlIDl1lD0geJjSzpuia+q9VLlg1Q47RfJ3a + agiWUEimVilzbDQCDVYSh3ZCQmdWs9L03rq6/QXH+CSaCAQAAA== headers: Access-Control-Allow-Credentials: - 'true' @@ -38,9 +38,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Fri, 01 Dec 2023 21:25:06 GMT + - Mon, 05 Feb 2024 12:24:48 GMT Etag: - - W/"3f2-y9+VxwqtePCRYovMzrv9Y2mmzrc" + - W/"408-glTYZ6Uxgu2pCgKN72yd6UNBr5A" Server: - nginx/1.18.0 (Ubuntu) Transfer-Encoding: diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py index 40977203414..8163bf7cea6 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py @@ -1,7 +1,7 @@ """Intrinio Index Historical Model.""" from datetime import datetime -from typing import Any, Dict, List, Literal, Optional +from typing import Any, Dict, List, Optional from dateutil.relativedelta import relativedelta from openbb_core.provider.abstract.fetcher import Fetcher @@ -9,10 +9,8 @@ from openbb_core.provider.standard_models.index_historical import ( IndexHistoricalData, IndexHistoricalQueryParams, ) -from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS from openbb_core.provider.utils.errors import EmptyDataError from openbb_core.provider.utils.helpers import amake_requests, get_querystring -from pydantic import Field, NonNegativeInt class IntrinioIndexHistoricalQueryParams(IndexHistoricalQueryParams): @@ -22,16 +20,7 @@ class IntrinioIndexHistoricalQueryParams(IndexHistoricalQueryParams): https://docs.intrinio.com/documentation/web_api/get_stock_market_index_historical_data_v2 """ - sort: Literal["asc", "desc"] = Field( - default="asc", - description="Sort order.", - alias="sort_order", - ) - limit: NonNegativeInt = Field( - default=10000, - description=QUERY_DESCRIPTIONS.get("limit", ""), - alias="page_size", - ) + __alias_dict__ = {"limit": "page_size", "sort": "sort_order"} class IntrinioIndexHistoricalData(IndexHistoricalData): diff --git a/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml index 33b72674f1d..718398eb2a7 100644 --- a/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml +++ b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_index_historical_fetcher.yaml @@ -9,30 +9,19 @@ interactions: Connection: - keep-alive method: GET - uri: https://api-v2.intrinio.com/indices/stock_market/$DJI/historical_data/level?api_key=MOCK_API_KEY&end_date=2023-06-06&page_size=10000&sort_order=asc&start_date=2023-01-01 + uri: https://api-v2.intrinio.com/indices/stock_market/$DJI/historical_data/level?api_key=MOCK_API_KEY&end_date=2024-02-05&interval=1d&page_size=10000&sort_order=asc&start_date=2024-01-01 response: body: string: !!binary | - H4sIANIhsGUAA4SYT28bNxDFv4qw6NEhyOEM//hmIJfkkEvbS4tCUKxNI0BepdLKjWPku3c2Btod - 8hm9WdIDyRm+38zQz8Pnw2U+nQ/3u+N2v5t3w+3vz4P+MQ63A3mKb3x442m4GR53x6t+OV2Px+83 - vST+J4kxxORiRjJeyyhVl6FMVjKq0TtfkCytV0sqSwHJ6lomIbskQBb8WpY9O7RYCGtVzdF5KFul - LHIo1VUUaFinjaMnHEFI/3sBIZtzBe8KDLKYC6jJ1YRkJmWe2QmSkUlZzOK4IpkxR6L6ymrGHDlG - fDYSI+PoCiOZMUfl6hillmzecsFWi9Yc6iGPIo1rd7Avyfn+bKRKI6uEIiXDncpEEwJXM+mtlJAl - qaGl1OA8IVk2zpXkUh+pykqbXrypMVKq1ZU+vdSwV7QuUI8LNbgQi6sRydjewmuriYmU9Op7ZMjA - t4SQEFnUAFjolbytkYEoq8SUmLDgAlciy6ggS1IDX1hMhC7KwEclaGFA7jC4UNHU4k3X7qCkJuov - IFoMKKWASI4Wg+h9dAJXM4HG6lHJjQ0GHINjuKkNVCPgHtFoMaBci4OLrSkgEnYFLWYoCNVXl9Bq - hoJQQnUBysyNBhF4NANBKJlxcg0ERJyc9BBEC0EoeqO1xz3avqGr6aZQZvwhSfs7Uq3tQV6ngNAb - PFoOKHhxhCKwHFDMTvoSExsOOBJqG7HhQMvkK5safyzdBQVqepBaUtlDRzM9SFfTOabfkxtckg+v - yExTZp1QYh8o24ktciGX+/LBLXxFL6EvH2zgg0WSm44h2mkFbWjHtVTYZbShGddiWuyNVKb9eC3M - oMSzBS8WPRr3SHE7sZXsAsqsndhq1r7S3zo3E1upGfVjbia2rGdLKG22BRVf0IDCzcRWMiox3Axs - ooAWFIEd2KIasqC0UddnAzxaMXelhRnIpJ3EJIBGJU0HWlwEioI0SHFQ2vt8SINUoOwylJm0JeUY - kCfNIJZCQaaU9hG09NreH9Jipd0xokgtVlE7lcDVyMo8cpvYHrSUBVD+pJnDfCDU9qTBismjJ6Y0 - WEkUNBZJgxUTpE+aWYyWaoTuys5iXlsyTJvtQVmHZjCLieWKcmL0rpWGK1+jiyhv6x4Ea640jyDP - WuRRlKYBUdXiAcbvZNGLXh0JJo/UsJeTbtq7IzW0iMrAiJWaBiT6fKfy/Y+b4TDtx6/D7fNw2Kta - P23p2+OHb3eqvjw9fDwd9duf3r5/p5+n3cOy4tvT35v3p2m8bN5N++tlPh92x83d43je/Tmq6v40 - zYdpnGaVfjid58+bu4dx+TfLj9+u03x+0l9+nQ7zuN/8POspL5vTp5Xo+mU5+vbTefzrOk73i3q/ - Oxyf9Kfj7jJvX37fv8TGL8/sX3y4DeF2eYx5/5sqTx8v4/lxNx9O0/Yy787zD3ngf1/la8E4mdVo - +K7Bjl/n7ZclpBdT/AMAAP//AwCMqInFMBIAAA== + H4sIAB/ZwGUAA4SUTW/bMAyG/4oh7JgRor4s5xagl/bQy7bLhsFQY3U14MidLWdNg/z3ye2ASQuB + ATpY4gOK7yvSZ/bUz3Gc+r0b2s5Fx7bfzix9eLZlggv1kWNabMOObljSYViG4bK5RsRfRNY1auCK + wmSOKckBGwpTBaY4SDKbLjBjAJHCbI4ZK4GTWJNjWmhAQ2DIi2yNhlpSGJaGIHBBYYVvuhHQWArT + /30BNHkmaRCQvLDOMZE8MzWF2dJaC4byDAvPrJFAVS9ykZZzBEslE0VzNFyD0hRWNIflBiTVQ0IX + l6oGkHonkdtmkTegSCwXaqWUdG0ybw6rTA2SUiqxuFSn/r6iRDF20mpswF5PgShHzxqtQInL9w3r + Q+df2PbM+i7RadeK1+P96y7R8+nwMA7p9MPN3W3aB3dYM96Mv6q7Mfi5ug3dMsepd0O1O/rJ/fCJ + 2o8h9sGHmND7cYpP1e7g1z/HW2wJcTqlyJfQR99Vn2Kqcq7GxwxantfS28fJ/1x82K905/rhlEKD + m2P7Hu9ybfIzx+26BHDOvyZyfJj9dHSxH0M7RzfFNxz/4P8APnSlU5ck1r/E9nmV9D5KvwEAAP// + AwCCQKM2AwUAAA== headers: Connection: - keep-alive @@ -41,7 +30,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 23 Jan 2024 20:30:10 GMT + - Mon, 05 Feb 2024 12:48:31 GMT Transfer-Encoding: - chunked Vary: diff --git a/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py b/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py index bc2986f1285..6afacc629d0 100644 --- a/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py +++ b/openbb_platform/providers/intrinio/tests/test_intrinio_fetchers.py @@ -247,8 +247,8 @@ def test_intrinio_market_indices_fetcher(credentials=test_credentials): def test_intrinio_index_historical_fetcher(credentials=test_credentials): params = { "symbol": "DJI", - "start_date": date(2023, 1, 1), - "end_date": date(2023, 6, 6), + "start_date": date(2024, 1, 1), + "end_date": date(2024, 2, 5), } fetcher = IntrinioIndexHistoricalFetcher() diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py index d2b3f83d4eb..31a38b5261c 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py @@ -9,7 +9,6 @@ from openbb_core.provider.standard_models.index_historical import ( IndexHistoricalData, IndexHistoricalQueryParams, ) -from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS from openbb_polygon.utils.helpers import get_data_many from pydantic import Field, PositiveInt @@ -23,12 +22,6 @@ class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): timespan: Literal["minute", "hour", "day", "week", "month", "quarter", "year"] = ( Field(default="day", description="Timespan of the data.") ) - sort: Literal["asc", "desc"] = Field( - default="desc", description="Sort order of the data." - ) - limit: PositiveInt = Field( - default=49999, description=QUERY_DESCRIPTIONS.get("limit", "") - ) adjusted: bool = Field(default=True, description="Whether the data is adjusted.") multiplier: PositiveInt = Field( default=1, description="Multiplier of the timespan." diff --git a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml index 305a0ebd7e8..84afa7c8c45 100644 --- a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml +++ b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml @@ -3,57 +3,57 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive method: GET - uri: https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/2023-01-01/2023-05-10?adjusted=True&apiKey=MOCK_API_KEY&limit=49999&sort=desc + uri: https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/2023-01-01/2023-05-10?adjusted=True&apiKey=MOCK_API_KEY&limit=10000&sort=asc response: body: string: !!binary | - H4sIAAAAAAAA/2RYTYsk6c38L3kuhL5D6uv7XozBvhqMMUO7l1m8eNmZnoNZ9r8bZdfzVHf2Hmun - M1JSKCKUvx+vPz//++Xb8XT86ekv//+343b89uPl23//79cf/3k9nsJvx7eX7z9+ef1+PP399+PX - 40nMuMjFA50qcjuezx8dVAqHMcrqdnw9fy0nlxJYWnfejl/mV2UnVBZrV3vejtfjSbIs24vnvz9u - dyjVonRtQYbwwlIWEnFm4/byO5aGU3E2olu87ljSRlWqYcyu/cDi8guWg7gN2trGurBa5g2cu6My - V12s5GbsUYbpwcbi4rCEcz6wQpU/YjGYskNERbOwsKJJTM3Skd6rrhYSLqlsNrE7FkdTz99LhWBD - aeqlhSxOPHOx7LJ8g9IuJS8Ghzsz7lCcTizZKPH2eIPStiIPl2qBwzeWIC8tFDUSVpPU6lgtZGNS - LgvvwKaGmhA4WjtLsarSJHbViCxr3VDczFdmBHn52a7oukOJGGV0ejm3xoJyoTB2V+6wNS32HBby - /Bh4h8WWV6weviEr27GnZUKeCBfLHL68YRXIwdoZ7bmZUUnWyRBJT1tYQ2y9tNCazAvV0oXNeA/q - Ss9M8PDt62KsFSxbdU3LuJPawti0O2tDZdTHFmqnkXK2hYrZ6mAysaaZSCev3RIEpQBSAaS9J0YD - sBB22VAB+dhBrUxKF+0oi4o7CYtzZoiUYAyzv55P1aaU8qrZ74WFMnIBdHYjNpRX6KUqDuKK5kCc |