OpenBB-finance/OpenBB · error · OpenBBError

The query filters resulted in no data. Try again with differ

Error message

The query filters resulted in no data. Try again with different date parameters.

What it means

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.

Source

Thrown at openbb_platform/providers/federal_reserve/openbb_federal_reserve/models/total_factor_productivity.py:627

        data_df = data_df.rename(columns={date_col: "date"})

        # Apply date filters
        if query.start_date:
            data_df = data_df[data_df["date"] >= query.start_date]

        if query.end_date:
            data_df = data_df[data_df["date"] <= query.end_date]

        data_df = data_df.replace({np.nan: None})

        results = [
            FederalReserveTfpData.model_validate(row.to_dict())
            for _, row in data_df.iterrows()
        ]

        if not results:
            raise OpenBBError(
                "The query filters resulted in no data. "
                "Try again with different date parameters."
            )

        return results

View on GitHub (pinned to 3e071fcc2c)

Solutions

  1. Widen the date range — TFP data is annual/quarterly and lags; try start_date several years back with no end_date.
  2. Verify the series' actual coverage on the Fed's TFP page before querying.
  3. Handle the OpenBBError as an empty-result signal in your pipeline.

Example fix

// before
res = obb.economy.tfp(provider='federal_reserve', start_date='2025-01-01')
// after
res = obb.economy.tfp(provider='federal_reserve', start_date='2000-01-01')
Defensive patterns

Strategy: validation

Validate before calling

from datetime import date
assert end_date is None or end_date <= date.today()
assert start_date is None or start_date < date.today()  # TFP lags heavily

Try / catch

try:
    res = obb.economy.tfp(provider='federal_reserve', start_date=s, end_date=e)
except OpenBBError:
    res = obb.economy.tfp(provider='federal_reserve')  # unfiltered fallback

Prevention

When it happens

Trigger: 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.

Common situations: Requesting recent dates when the TFP series lags by quarters/years; passing dates as strings in a format that compares incorrectly; inverted date order.

Related errors


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