feat: reported financials

This commit is contained in:
Diogo Sousa
2024-02-09 15:42:08 +00:00
parent 283c9a8808
commit e4ca7ad037
2 changed files with 8 additions and 6 deletions

View File

@@ -40,11 +40,7 @@ class ReportedFinancialsQueryParams(QueryParams):
@classmethod
def upper_symbol(cls, v: str):
"""Convert symbol to uppercase."""
if "," in v:
_warn(
f"{QUERY_DESCRIPTIONS.get('symbol_list_warning', '')} {v.split(',')[0].upper()}"
)
return v.split(",")[0].upper() if "," in v else v.upper()
return v.upper()
class ReportedFinancialsData(Data):

View File

@@ -13,9 +13,10 @@ from openbb_core.provider.utils.helpers import (
amake_requests,
to_snake_case,
)
from openbb_core.provider.utils.validators import check_single
from openbb_intrinio.utils.helpers import get_data_one
from pandas import DataFrame
from pydantic import Field
from pydantic import Field, field_validator
_warn = warnings.warn
@@ -43,6 +44,11 @@ class IntrinioReportedFinancialsQueryParams(ReportedFinancialsQueryParams):
description="The specific fiscal year. Reports do not go beyond 2008.",
)
@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def validate_symbol(cls, v: str) -> str:
return check_single(v)
class IntrinioReportedFinancialsData(ReportedFinancialsData):
"""