{"record":{"id":"d23d2f33fd9e55fb","repo":"OpenBB-finance/OpenBB","slug":"typeerror-te-check-the-data-types-in-your-resu","errorCode":null,"errorMessage":"TypeError: {te}. Check the data types in your results.","messagePattern":"TypeError: (.+?)\\. Check the data types in your results\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/app/model/obbject.py","lineNumber":279,"sourceCode":"                df.sort_index(axis=1, inplace=True)\n            df = df.dropna(axis=1, how=\"all\")\n\n            # Sort by specified column\n            if sort_by:\n                df.sort_values(\n                    by=sort_by,\n                    ascending=ascending if ascending is not None else True,\n                    inplace=True,\n                )\n\n        except OpenBBError as e:\n            raise e\n        except ValueError as ve:\n            raise OpenBBError(\n                f\"ValueError: {ve}. Ensure the data format matches the expected format.\"\n            ) from ve\n        except TypeError as te:\n            raise OpenBBError(\n                f\"TypeError: {te}. Check the data types in your results.\"\n            ) from te\n        except Exception as ex:\n            raise OpenBBError(f\"An unexpected error occurred: {ex}\") from ex\n\n        return df\n\n    def to_polars(self) -> \"PolarsDataFrame\":  # type: ignore\n        \"\"\"Convert results field to polars dataframe.\"\"\"\n        try:\n            from polars import from_pandas  # type: ignore # pylint: disable=import-outside-toplevel\n        except ImportError as exc:\n            raise ImportError(\n                \"Please install polars: `pip install polars pyarrow`  to use this method.\"\n            ) from exc\n\n        return from_pandas(self.to_dataframe(index=None))\n","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/app/model/obbject.py#L261-L297","documentation":"Raised by the economic-indicators model validator when the parsed symbol list contains both tables (H_-prefixed identifiers or known hierarchy IDs) and plain indicators. The endpoint's table mode uses ImfTableBuilder against a single dataflow, which is a different code path from indicator mode, so mixing is unrepresentable in one request.","triggerScenarios":"`symbol='ARGSDMX::H_CPI,IFS::NGDP_XDC'` (an H_ table plus an indicator), or a hierarchy ID (confirmed against the dataflow's hierarchy list) mixed with regular codes. Detection of hierarchy IDs requires a metadata lookup; if that lookup fails the token is assumed to be an indicator.","commonSituations":"Power users pasting a combined symbol list; batch jobs concatenating 'interesting things' lists; assuming one request can fetch a whole table plus extra series.","solutions":["Split into two requests: one for the table, one for the indicator list.","Keep H_-prefixed symbols in their own call — they always mean 'table'.","When in doubt, resolve symbols via available_indicators()/list_tables() and group by type before calling."],"exampleFix":"# before\nres = obb.economy.economic_indicators(provider='imf', symbol='STA::H_CPI,IFS::NGDP_XDC', country='USA')\n\n# after\ntable_res = obb.economy.economic_indicators(provider='imf', symbol='STA::H_CPI', country='USA')\nind_res = obb.economy.economic_indicators(provider='imf', symbol='IFS::NGDP_XDC', country='USA')","handlingStrategy":"validation","validationCode":"def split_tables_and_indicators(symbol: str) -> tuple[list[str], list[str]]:\n    tables, indicators = [], []\n    for s in symbol.split(','):\n        (tables if s.strip().split('::', 1)[1].startswith('H_') else indicators).append(s.strip())\n    if tables and indicators:\n        raise ValueError(f'Cannot mix tables {tables} with indicators {indicators}; issue separate requests.')\n    return tables, indicators\n\ntables, indicators = split_tables_and_indicators(symbol)","typeGuard":"def is_table_symbol(s: str) -> bool:\n    _, sep, ident = s.strip().partition('::')\n    return bool(sep) and ident.upper().startswith('H_')","tryCatchPattern":null,"preventionTips":["Group symbols by type (H_ prefix / hierarchy ID = table) before the call.","Keep table requests and indicator requests in separate code paths — they use different builders downstream."],"tags":["imf","openbb","validation","symbol","table","pydantic"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}