OpenBB-finance/OpenBB · error · OpenBBError

Required field missing -> symbol

Error message

Required field missing -> symbol

What it means

Raised by a pydantic field_validator (mode='before') on the QueryParams model for Intrinio company news. The Intrinio company news endpoint is per-symbol, so the provider declares symbol mandatory even though the shared QueryParams class types it as optional (default=None). The validator runs at request-parameter validation time and raises OpenBBError before any HTTP call is made when symbol is falsy.

Source

Thrown at openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py:95

        ge=0,
        le=1,
        description="News stories will have a business relevance score more than this value."
        + " Unsupported for yahoo source. Value is a decimal between 0 and 1.",
    )
    business_relevance_less_than: float | None = Field(
        default=None,
        ge=0,
        le=1,
        description="News stories will have a business relevance score less than this value."
        + " Unsupported for yahoo source. Value is a decimal between 0 and 1.",
    )

    @field_validator("symbol", mode="before", check_fields=False)
    @classmethod
    def _symbol_mandatory(cls, v):
        """Symbol mandatory validator."""
        if not v:
            raise OpenBBError("Required field missing -> symbol")
        return v


class IntrinioCompanyNewsData(CompanyNewsData):
    """Intrinio Company News Data."""

    __alias_dict__ = {
        "date": "publication_date",
        "sentiment": "article_sentiment",
        "sentiment_confidence": "article_sentiment_confidence",
        "symbols": "symbol",
    }
    source: str | None = Field(
        default=None,
        description="The source of the news article.",
    )
    summary: str | None = Field(
        default=None,

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Pass a non-empty symbol: news.company_news(provider='intrinio', symbol='AAPL')
  2. For comma-separated lists, ensure the string is not empty before splitting: symbol='AAPL,MSFT'
  3. If you want market-wide news without a symbol, use a provider/router that supports it, e.g. news.world(provider=...) instead of intrinio company news

Example fix

# before
obb.news.company_news(provider="intrinio")

# after
obb.news.company_news(provider="intrinio", symbol="AAPL")
Defensive patterns

Strategy: validation

Validate before calling

def validate_intrinio_news_params(symbol: str | None) -> str:
    """Raise before the router call when symbol is unusable for Intrinio news."""
    if not symbol or not symbol.strip():
        raise ValueError("provider 'intrinio' requires a non-empty symbol for company news")
    return symbol.strip()

Try / catch

from openbb_core.provider.abstract.error import OpenBBError

try:
    res = obb.news.company_news(provider="intrinio", symbol=symbol)
except OpenBBError as e:
    if "Required field missing -> symbol" in str(e):
        raise ValueError("intrinio company news needs a symbol") from e
    raise

Prevention

When it happens

Trigger: Calling news.company_news(provider='intrinio') with no symbol argument, with symbol='' or symbol=None. Because the router-level QueryParams allow omitting symbol (the standard model supports all-news queries), the error surfaces only after the router hands off to the Intrinio provider fetcher.

Common situations: Porting code from a provider where symbol is optional (e.g. benzinga world news) to intrinio; building generic news UIs that fetch headlines without a ticker; passing an empty string from a search box that the app did not validate.

Related errors


AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14). Data as JSON: /api/errors/aa18093bd828dd54. Report an issue: GitHub.