mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-26 11:12:50 +00:00
feat: reported financials
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user