OpenBB-finance/OpenBB · warning · EmptyDataError

No results were found with the query supplied. -> {query.que

Error message

No results were found with the query supplied. -> {query.query}

What it means

Raised as EmptyDataError by FMPCurrencyPairs.transform_data after the FMP fetch succeeded but the client-side 'query' filter matched nothing. The code does a case-insensitive substring search over symbol, fromCurrency, toCurrency, fromName and toName; if the filtered DataFrame has zero rows, this error names the offending query string.

Source

Thrown at openbb_platform/providers/fmp/openbb_fmp/models/currency_pairs.py:84

        # pylint: disable=import-outside-toplevel
        from pandas import DataFrame

        if not data:
            raise EmptyDataError("The request was returned empty.")

        df = DataFrame(data)

        if query.query:
            df = df[
                df["symbol"].str.contains(query.query, case=False)
                | df["fromCurrency"].str.contains(query.query, case=False)
                | df["toCurrency"].str.contains(query.query, case=False)
                | df["fromName"].str.contains(query.query, case=False)
                | df["toName"].str.contains(query.query, case=False)
            ]

        if len(df) == 0:
            raise EmptyDataError(
                f"No results were found with the query supplied. -> {query.query}"
            )
        return [FMPCurrencyPairsData.model_validate(d) for d in df.to_dict("records")]

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Retry with a shorter, correctly spelled substring (e.g. 'USD' instead of a full phrase)
  2. Inspect the unfiltered result set once (call without query) to see the exact symbol/name spellings FMP uses, then filter on those values
  3. Catch EmptyDataError and treat it as 'no match' rather than a failure

Example fix

# before
res = obb.currency.pairs(provider='fmp', query='dollar')  # no pair name contains 'dollar'

# after
res = obb.currency.pairs(provider='fmp', query='USD')     # matches fromCurrency/toCurrency
Defensive patterns

Strategy: validation

Validate before calling

from openbb_core.provider.utils.errors import EmptyDataError
from openbb.currency.pairs importPairsCache  # conceptually: fetch once, filter locally
all_pairs = obb.currency.pairs(provider='fmp').results  # unfiltered succeeds
terms = {p.symbol for p in all_pairs} | {p.from_currency for p in all_pairs}
q = 'usd'
will_match = any(q in str(t).lower() for t in terms)

Type guard

def query_matches_pair(q: str, pair) -> bool:
    q = q.lower()
    fields = (pair.symbol, pair.from_currency, pair.to_currency, getattr(pair, 'from_name', ''), getattr(pair, 'to_name', ''))
    return any(q in str(f or '').lower() for f in fields)

Try / catch

from openbb_core.provider.utils.errors import EmptyDataError
try:
    res = obb.currency.pairs(provider='fmp', query=term)
except EmptyDataError:
    res = []  # legitimate 'no match', not an error condition

Prevention

When it happens

Trigger: Calling obb.currency.pairs(query='XYZ') where 'XYZ' does not appear (case-insensitively) in any pair's symbol, fromCurrency, toCurrency, fromName or toName column. E.g. query='USDOLLAR' or a typo like query='EURU' when no name contains that substring.

Common situations: Typos in the search string, expecting exact-match semantics where substring matching is used, searching by a long currency name that FMP spells differently (e.g. 'Chinese Yuan' vs 'Yuan Renminbi'), or forgetting the filter is OR-based across five columns.

Related errors


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