mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-26 11:12:50 +00:00
feat: calendar ipo
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
"""Field validators"""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
def check_single(v: str) -> str:
|
||||
|
||||
def check_single(v: Optional[str]) -> Optional[str]:
|
||||
"""Check that string is not comma-separated string"""
|
||||
if "," in v:
|
||||
if v and "," in v:
|
||||
raise ValueError("multiple values are not allowed")
|
||||
return v
|
||||
|
||||
@@ -8,9 +8,10 @@ from openbb_core.provider.standard_models.calendar_ipo import (
|
||||
CalendarIpoQueryParams,
|
||||
)
|
||||
from openbb_core.provider.utils.helpers import get_querystring
|
||||
from openbb_core.provider.utils.validators import check_single
|
||||
from openbb_intrinio.utils.helpers import get_data_one
|
||||
from openbb_intrinio.utils.references import IntrinioCompany, IntrinioSecurity
|
||||
from pydantic import Field
|
||||
from pydantic import Field, field_validator
|
||||
|
||||
|
||||
class IntrinioCalendarIpoQueryParams(CalendarIpoQueryParams):
|
||||
@@ -38,6 +39,11 @@ class IntrinioCalendarIpoQueryParams(CalendarIpoQueryParams):
|
||||
alias="offer_amount_less_than",
|
||||
)
|
||||
|
||||
@field_validator("symbol", mode="before", check_fields=False)
|
||||
@classmethod
|
||||
def validate_symbol(cls, v: str) -> str:
|
||||
return check_single(v)
|
||||
|
||||
|
||||
class IntrinioCalendarIpoData(CalendarIpoData):
|
||||
"""Intrinio IPO Calendar Data."""
|
||||
|
||||
Reference in New Issue
Block a user