diff options
author | Danglewood <85772166+deeleeramone@users.noreply.github.com> | 2024-01-17 07:16:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 15:16:40 +0000 |
commit | 37c7b146052d8c89f010f59c6353e8732960cc15 (patch) | |
tree | 0a3caf27b6e6f4c591b60521c97790d75514b128 | |
parent | 54b6a2e22a5df4391683c651c2fec45a740a8141 (diff) |
hotfix/fix-company-filings: Fixes too many mandatory fields. (#5909)
* Fixes too many mandatory fields.
* black
* black again
---------
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
-rw-r--r-- | openbb_platform/core/openbb_core/provider/standard_models/company_filings.py | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/company_filings.py b/openbb_platform/core/openbb_core/provider/standard_models/company_filings.py index 2f20b72a9a2..06e73e1603e 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/company_filings.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/company_filings.py @@ -26,8 +26,7 @@ class CompanyFilingsQueryParams(QueryParams): form_type: Optional[str] = Field( default=None, description=( - "Filter by form type. Visit https://www.sec.gov/forms " - "for a list of supported form types." + "Filter by form type. Check the data provider for available types." ), ) limit: NonNegativeInt = Field( @@ -46,28 +45,24 @@ class CompanyFilingsQueryParams(QueryParams): class CompanyFilingsData(Data): """Company Filings Data.""" + filing_date: dateType = Field(description="The date of the filing.") + accepted_date: Optional[datetime] = Field( + default=None, description="Accepted date of the filing." + ) symbol: Optional[str] = Field( default=None, description=DATA_DESCRIPTIONS.get("symbol", "") ) cik: Optional[str] = Field( default=None, description=DATA_DESCRIPTIONS.get("cik", "") ) - filing_date: dateType = Field(description="Filing date of the SEC report.") - accepted_date: datetime = Field(description="Accepted date of the SEC report.") - report_type: str = Field(description="Type of the SEC report.") - filing_url: str = Field(description="URL to the filing page on the SEC site.") - report_url: str = Field(description="URL to the actual report on the SEC site.") - - @field_validator("symbol", mode="before", check_fields=False) - @classmethod - def upper_symbol(cls, v: Union[str, List[str], Set[str]]): - """Convert symbol to uppercase.""" - if isinstance(v, str): - return v.upper() - return ",".join([symbol.upper() for symbol in list(v)]) if v else None + report_type: Optional[str] = Field(default=None, description="Type of filing.") + filing_url: Optional[str] = Field( + default=None, description="URL to the filing page." + ) + report_url: str = Field(description="URL to the actual report.") - @field_validator("date", "filing_date", mode="before", check_fields=False) + @field_validator("filing_date", "accepted_date", mode="before", check_fields=False) @classmethod def convert_date(cls, v: str): """Convert date to date type.""" - return parser.parse(str(v)).date() + return parser.parse(str(v)).date() if v else None |