{"record":{"id":"58178eeb6f0c512c","repo":"OpenBB-finance/OpenBB","slug":"no-results-were-found-with-the-query-supplied","errorCode":null,"errorMessage":"No results were found with the query supplied. -> {query.query}","messagePattern":"No results were found with the query supplied\\. -> (.+?)","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/fmp/openbb_fmp/models/currency_pairs.py","lineNumber":84,"sourceCode":"        # pylint: disable=import-outside-toplevel\n        from pandas import DataFrame\n\n        if not data:\n            raise EmptyDataError(\"The request was returned empty.\")\n\n        df = DataFrame(data)\n\n        if query.query:\n            df = df[\n                df[\"symbol\"].str.contains(query.query, case=False)\n                | df[\"fromCurrency\"].str.contains(query.query, case=False)\n                | df[\"toCurrency\"].str.contains(query.query, case=False)\n                | df[\"fromName\"].str.contains(query.query, case=False)\n                | df[\"toName\"].str.contains(query.query, case=False)\n            ]\n\n        if len(df) == 0:\n            raise EmptyDataError(\n                f\"No results were found with the query supplied. -> {query.query}\"\n            )\n        return [FMPCurrencyPairsData.model_validate(d) for d in df.to_dict(\"records\")]\n","sourceCodeStart":66,"sourceCodeEnd":88,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/fmp/openbb_fmp/models/currency_pairs.py#L66-L88","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry with a shorter, correctly spelled substring (e.g. 'USD' instead of a full phrase)","Inspect the unfiltered result set once (call without query) to see the exact symbol/name spellings FMP uses, then filter on those values","Catch EmptyDataError and treat it as 'no match' rather than a failure"],"exampleFix":"# before\nres = obb.currency.pairs(provider='fmp', query='dollar')  # no pair name contains 'dollar'\n\n# after\nres = obb.currency.pairs(provider='fmp', query='USD')     # matches fromCurrency/toCurrency","handlingStrategy":"validation","validationCode":"from openbb_core.provider.utils.errors import EmptyDataError\nfrom openbb.currency.pairs importPairsCache  # conceptually: fetch once, filter locally\nall_pairs = obb.currency.pairs(provider='fmp').results  # unfiltered succeeds\nterms = {p.symbol for p in all_pairs} | {p.from_currency for p in all_pairs}\nq = 'usd'\nwill_match = any(q in str(t).lower() for t in terms)","typeGuard":"def query_matches_pair(q: str, pair) -> bool:\n    q = q.lower()\n    fields = (pair.symbol, pair.from_currency, pair.to_currency, getattr(pair, 'from_name', ''), getattr(pair, 'to_name', ''))\n    return any(q in str(f or '').lower() for f in fields)","tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.currency.pairs(provider='fmp', query=term)\nexcept EmptyDataError:\n    res = []  # legitimate 'no match', not an error condition","preventionTips":["Fetch the unfiltered list once and do local substring filtering instead of server-side query","Normalize user input (trim, lowercase) before passing as query","Treat EmptyDataError from a filtered query as an empty result, not a failure"],"tags":["fmp","empty-data","filter","currency"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}