feat: balancesheet

This commit is contained in:
Diogo Sousa
2024-02-09 14:57:02 +00:00
parent f08b0a6082
commit 947bb512bb
6 changed files with 35 additions and 8 deletions

View File

@@ -30,12 +30,7 @@ class BalanceSheetQueryParams(QueryParams):
@field_validator("symbol", mode="before", check_fields=False)
@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
class BalanceSheetData(Data):

View File

@@ -0,0 +1,8 @@
"""Field validators"""
def check_single(v: str) -> str:
"""Check that string is not comma-separated string"""
if "," in v:
raise ValueError("multiple values are not allowed")
return v