{"record":{"id":"0679088fe914f110","repo":"OpenBB-finance/OpenBB","slug":"the-query-filters-resulted-in-no-data-try-again-w-067908","errorCode":null,"errorMessage":"The query filters resulted in no data. Try again with different date parameters.","messagePattern":"The query filters resulted in no data\\. Try again with different date parameters\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/total_factor_productivity.py","lineNumber":627,"sourceCode":"\n        data_df = data_df.rename(columns={date_col: \"date\"})\n\n        # Apply date filters\n        if query.start_date:\n            data_df = data_df[data_df[\"date\"] >= query.start_date]\n\n        if query.end_date:\n            data_df = data_df[data_df[\"date\"] <= query.end_date]\n\n        data_df = data_df.replace({np.nan: None})\n\n        results = [\n            FederalReserveTfpData.model_validate(row.to_dict())\n            for _, row in data_df.iterrows()\n        ]\n\n        if not results:\n            raise OpenBBError(\n                \"The query filters resulted in no data. \"\n                \"Try again with different date parameters.\"\n            )\n\n        return results\n","sourceCodeStart":609,"sourceCodeEnd":633,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/total_factor_productivity.py#L609-L633","documentation":"Raised at the end of the time-series branch of the TFP transform: rows existed in the source table, but after applying query.start_date / query.end_date filters the data_df is empty. An OpenBBError indicating the user's date window excluded everything, not that the source is broken.","triggerScenarios":"Calling TFP with start_date after the latest available observation, end_date before the earliest, or a window falling in a publication gap; frequency conversion (quarter 'YYYY:QN' parsing) can also shift effective dates outside the requested window.","commonSituations":"Requesting recent dates when the TFP series lags by quarters/years; passing dates as strings in a format that compares incorrectly; inverted date order.","solutions":["Widen the date range — TFP data is annual/quarterly and lags; try start_date several years back with no end_date.","Verify the series' actual coverage on the Fed's TFP page before querying.","Handle the OpenBBError as an empty-result signal in your pipeline."],"exampleFix":"// before\nres = obb.economy.tfp(provider='federal_reserve', start_date='2025-01-01')\n// after\nres = obb.economy.tfp(provider='federal_reserve', start_date='2000-01-01')","handlingStrategy":"validation","validationCode":"from datetime import date\nassert end_date is None or end_date <= date.today()\nassert start_date is None or start_date < date.today()  # TFP lags heavily","typeGuard":null,"tryCatchPattern":"try:\n    res = obb.economy.tfp(provider='federal_reserve', start_date=s, end_date=e)\nexcept OpenBBError:\n    res = obb.economy.tfp(provider='federal_reserve')  # unfiltered fallback","preventionTips":["Remember TFP lags by quarters — request wide historical windows","Fall back to the unfiltered query when filters empty the result"],"tags":["openbb","date-filter","tfp","empty-data"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}