{"record":{"id":"7fa7377031e33b64","repo":"OpenBB-finance/OpenBB","slug":"no-data-found-for-the-provided-dates-data-has-a-r","errorCode":null,"errorMessage":"No data found for the provided dates. Data has a range from {df.date.min()} to {df.date.max()}.","messagePattern":"No data found for the provided dates\\. Data has a range from (.+?) to (.+?)\\.","errorType":"exception","errorClass":"EmptyDataError","httpStatus":null,"severity":"warning","filePath":"openbb_platform/providers/econdb/openbb_econdb/models/port_volume.py","lineNumber":172,"sourceCode":"            \"Dwelling times imports\": \"import_dwell_time\",\n            \"Dwelling times exports\": \"export_dwell_time\",\n            \"Imports\": \"import_teu\",\n            \"Exports\": \"export_teu\",\n        }\n        df = df.rename(columns=cols_map).reset_index().convert_dtypes()\n        df.country = df.country.map(\n            {v: k.replace(\"_\", \" \").title() for k, v in COUNTRY_MAP.items()}\n        )\n        df.date = to_datetime(df.date).dt.date\n\n        if query.start_date:\n            df = df[df.date >= query.start_date]\n\n        if query.end_date:\n            df = df[df.date <= query.end_date]\n\n        if len(df) == 0:\n            raise EmptyDataError(\n                f\"No data found for the provided dates. Data has a range from {df.date.min()} to {df.date.max()}.\"\n            )\n\n        return [\n            EconDbPortVolumeData.model_validate(d) for d in df.to_dict(orient=\"records\")\n        ]\n","sourceCodeStart":154,"sourceCodeEnd":179,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/econdb/openbb_econdb/models/port_volume.py#L154-L179","documentation":"EmptyDataError raised at the end of EconDbPortVolumeFetcher.transform_data: after mapping countries and applying start_date/end_date filters, the DataFrame has zero rows, and the message reports the dataset's actual min/max dates. The data exists but lies outside your requested window (dataset starts 2022-04-04; see the query-param validator in the same file).","triggerScenarios":"economy.port_volume(provider='econdb', start_date/end_date) filtering out all rows: end_date before 2022-04-04, start_date after the dataset's last date, or a window narrower than the weekly data points.","commonSituations":"Recent end_date beyond the latest published week; windows that fall between weekly data points; assuming longer history than 2022-04-04.","solutions":["Read the min/max dates from the error message and set your window inside that range.","Omit dates to fetch the full range, then filter locally.","Keep end_date at least a few days before today to account for publication lag."],"exampleFix":"# before\nobb.economy.port_volume(provider='econdb', start_date='2026-08-10', end_date='2026-08-14')  # likely unpublished week\n\n# after\nobb.economy.port_volume(provider='econdb')  # full range; filter locally afterwards","handlingStrategy":"validation","validationCode":"full = obb.economy.port_volume(provider='econdb').to_df()\nlo, hi = full['date'].min(), full['date'].max()\nif not (lo <= start_date <= hi) or not (lo <= end_date <= hi):\n    start_date, end_date = max(start_date, lo), min(end_date, hi)","typeGuard":null,"tryCatchPattern":"from openbb_core.provider.utils.errors import EmptyDataError\ntry:\n    res = obb.economy.port_volume(provider='econdb', start_date=s, end_date=e)\nexcept EmptyDataError as err:\n    # message contains the true range: 'Data has a range from X to Y.'\n    logger.warning(str(err))\n    res = obb.economy.port_volume(provider='econdb')","preventionTips":["Parse the reported min/max range out of the error and re-query inside it.","Account for weekly publication lag on end_date.","Fetch full range once, cache it, and slice locally."],"tags":["date-range","empty-data","port-volume","econdb"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}