{"record":{"id":"19d28d7c54dd919d","repo":"OpenBB-finance/OpenBB","slug":"no-results-found-for-the-provided-query","errorCode":null,"errorMessage":"No results found for the provided query.","messagePattern":"No results found for the provided query\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/bls/openbb_bls/models/search.py","lineNumber":120,"sourceCode":"                if query.include_extras is True\n                else df.filter(\n                    items=[\"series_id\", \"series_title\", \"survey_name\"], axis=1\n                ).to_dict(orient=\"records\")\n            )\n        else:\n            combined_mask = Series([True] * len(df))\n            for term in terms:\n                mask = df.apply(\n                    lambda row, term=term: row.astype(str).str.contains(\n                        term, case=False, regex=True, na=False\n                    )\n                ).any(axis=1)\n                combined_mask &= mask\n\n            matches = df[combined_mask]\n\n            if matches.empty:\n                raise EmptyDataError(\"No results found for the provided query.\")\n\n            records = (\n                matches.to_dict(orient=\"records\")\n                if query.include_extras is True\n                else matches.filter(\n                    items=[\"series_id\", \"series_title\", \"survey_name\"], axis=1\n                ).to_dict(orient=\"records\")\n            )\n\n        return records\n\n    @staticmethod\n    def transform_data(\n        query: BlsSearchQueryParams,\n        data: list[dict],\n        **kwargs: Any,\n    ) -> AnnotatedResult[list[BlsSearchData]]:\n        \"\"\"Transform the data.\"\"\"","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/bls/openbb_bls/models/search.py#L102-L138","documentation":"Raised by the BLS search model when the pandas DataFrame built from BLS series metadata has zero rows matching every search term (case-insensitive substring/regex match across all columns). It means the BLS catalog contains no series matching the combined terms. This is an EmptyDataError - a normal 'no match' result for a search operation.","triggerScenarios":"Calling obb.economy.survey(search='nonexistent term'), using multiple terms where no single series contains all of them (terms are AND-ed via combined_mask), or regex-special characters in a term that match nothing.","commonSituations":"Typo'd search terms; overly narrow multi-term queries; searching for survey names that exist in FRED but not in BLS's local static catalog; regex metacharacters like '(' in terms.","solutions":["Use fewer or broader search terms - all terms must match the same row","Check spelling and prefer canonical BLS survey names (e.g. 'CPI', 'JOLTS', 'unemployment')","Escape regex special characters if a term contains them, since matching is regex=True","Catch EmptyDataError and report 'no series found' to end users"],"exampleFix":"// before\nobb.economy.survey(search='consumer price indeks 1982')  # EmptyDataError\n\n// after\nfrom openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.economy.survey(search='consumer price index')\nexcept EmptyDataError:\n    res = []  # report no matching BLS series","handlingStrategy":"validation","validationCode":"import re\n\ndef sanitize_search_terms(terms: list[str]) -> list[str]:\n    # terms are regex-matched and AND-ed; escape metacharacters, keep terms few\n    return [re.escape(t.strip()) for t in terms if t.strip()]","typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.survey(search=query)\nexcept EmptyDataError:\n    res = []  # no matching BLS series","preventionTips":["Pre-normalize search terms (trim, escape regex characters)","Prefer one broad term over several narrow AND-ed terms","Treat EmptyDataError as an expected search outcome in UIs"],"tags":["bls","search","empty-data","validation"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}