diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/major_indices_eod.py b/openbb_sdk/providers/fmp/openbb_fmp/models/major_indices_eod.py index a3e5d5bd44c..da02ece26b6 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/major_indices_eod.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/major_indices_eod.py @@ -5,7 +5,6 @@ from datetime import datetime from typing import Any, Dict, List, Literal, Optional from openbb_provider.abstract.fetcher import Fetcher -from openbb_provider.descriptions import DATA_DESCRIPTIONS from openbb_provider.helpers import get_querystring from openbb_provider.models.major_indices_eod import ( MajorIndicesEODData, @@ -33,7 +32,6 @@ class FMPMajorIndicesEODQueryParams(MajorIndicesEODQueryParams): class FMPMajorIndicesEODData(MajorIndicesEODData): """FMP Major Indices end of day Data.""" - date: datetime = Field(description=DATA_DESCRIPTIONS.get("date", "")) adjClose: Optional[float] = Field( description="Adjusted Close Price of the symbol.", alias="adj_close", @@ -54,9 +52,6 @@ class FMPMajorIndicesEODData(MajorIndicesEODData): alias="change_percent", default=None, ) - vwap: Optional[float] = Field( - description="Volume Weighted Average Price of the symbol.", default=None - ) label: Optional[str] = Field( description="Human readable format of the date.", default=None ) diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/major_indices_eod.py b/openbb_sdk/providers/polygon/openbb_polygon/models/major_indices_eod.py index c0e7791df82..35e04ccce40 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/major_indices_eod.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/major_indices_eod.py @@ -10,7 +10,7 @@ from openbb_provider.models.major_indices_eod import ( MajorIndicesEODData, MajorIndicesEODQueryParams, ) -from pydantic import Field, PositiveFloat, PositiveInt, validator +from pydantic import Field, PositiveInt, validator from openbb_polygon.utils.helpers import get_data @@ -47,15 +47,12 @@ class PolygonMajorIndicesEODData(MajorIndicesEODData): "low": "l", "close": "c", "volume": "v", + "vwap": "vw", } - t: datetime = Field(description="The timestamp of the data.") n: PositiveInt = Field( description="The number of transactions for the symbol in the time period." ) - vw: PositiveFloat = Field( - description="The volume weighted average price of the symbol." - ) @validator("t", pre=True, check_fields=False) def time_validate(cls, v): # pylint: disable=E0213 @@ -106,5 +103,5 @@ class PolygonMajorIndicesEODFetcher( @staticmethod def transform_data( data: List[PolygonMajorIndicesEODData], - ) -> List[PolygonMajorIndicesEODData]: - return data + ) -> List[MajorIndicesEODData]: + return [MajorIndicesEODData.parse_obj(d.dict()) for d in data] diff --git a/openbb_sdk/sdk/provider/openbb_provider/models/major_indices_eod.py b/openbb_sdk/sdk/provider/openbb_provider/models/major_indices_eod.py index 6026cb789ca..ebad49b62f1 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/models/major_indices_eod.py +++ b/openbb_sdk/sdk/provider/openbb_provider/models/major_indices_eod.py @@ -33,3 +33,4 @@ class MajorIndicesEODData(Data): low: PositiveFloat = Field(description=DATA_DESCRIPTIONS.get("low", "")) close: PositiveFloat = Field(description=DATA_DESCRIPTIONS.get("close", "")) volume: float = Field(description=DATA_DESCRIPTIONS.get("volume", "")) + vwap: Optional[float] = Field(description=DATA_DESCRIPTIONS.get("vwap", ""))