{"record":{"id":"00607dc305174587","repo":"OpenBB-finance/OpenBB","slug":"asset-asset-not-supported-expected-json-or","errorCode":null,"errorMessage":"Asset '{asset}' not supported. Expected .json or .xz file.","messagePattern":"Asset '(.+?)' not supported\\. Expected \\.json or \\.xz file\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/bls/openbb_bls/utils/helpers.py","lineNumber":380,"sourceCode":"def open_asset(asset: str) -> Union[\"DataFrame\", dict]:\n    \"\"\"Open a static file asset for series IDs or code maps.\"\"\"\n    # pylint: disable=import-outside-toplevel\n    import os  # noqa\n    import json\n    from importlib.resources import files\n    from pathlib import Path\n    from numpy import nan\n    from openbb_core.app.model.abstract.error import OpenBBError\n    from pandas import read_csv\n\n    if \".xz\" not in asset and \"series\" in asset:\n        asset = asset + \".xz\"\n    elif \".json\" not in asset and \"codes\" in asset:\n        asset = asset + \".json\"\n    elif \".json\" in asset or \".xz\" in asset:\n        pass\n    else:\n        raise OpenBBError(f\"Asset '{asset}' not supported. Expected .json or .xz file.\")\n\n    assets_path = Path(str(files(\"openbb_bls\").joinpath(\"assets\")))\n\n    if not os.path.exists(assets_path.joinpath(asset)):\n        raise OpenBBError(f\"Asset '{asset}' not found.\")\n\n    if asset.endswith(\".json\"):\n        with open(assets_path.joinpath(asset)) as f:\n            return json.load(f)\n    else:\n        with open(assets_path.joinpath(asset), \"rb\") as f:\n            df = read_csv(f, compression=\"xz\", low_memory=False, dtype=\"str\")\n        return df.replace({nan: None, \"nan\": None, \"''\": None}).dropna(\n            how=\"all\", axis=1\n        )\n\n\nasync def update_static_asset(category: str) -> None:","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/bls/openbb_bls/utils/helpers.py#L362-L398","documentation":"Raised by the BLS asset loader when the requested asset name contains neither '.json' nor '.xz' and does not match the 'series'/'codes' auto-suffix rules. The loader only supports the packaged JSON code maps and xz-compressed series CSVs, so any other filename is rejected before hitting the filesystem. It is an input-validation OpenBBError.","triggerScenarios":"Calling get_survey_asset('foo') or get_survey_asset('series.txt') - a name with no recognized extension and no 'series'/'codes' substring to auto-append one; also names like 'metadata.csv'.","commonSituations":"Contributors adding new asset types (e.g. parquet) without updating the loader; typos in asset names inside helpers; passing a full path instead of a bare filename.","solutions":["Pass a bare filename ending in .json or .xz, or containing 'series'/'codes' so the extension is auto-appended","Verify the file exists under openbb_bls/assets/","If a new asset type is genuinely needed, extend the loader's branch chain rather than bypassing it"],"exampleFix":"# before\ndf = get_survey_asset('cu_series')  # no auto-match -> OpenBBError\n\n# after\ndf = get_survey_asset('cu_series.xz')  # explicit supported extension","handlingStrategy":"validation","validationCode":"def is_supported_asset(name: str) -> bool:\n    return name.endswith(('.json', '.xz')) or 'series' in name or 'codes' in name","typeGuard":"def is_supported_asset(name: str) -> bool:\n    return name.endswith(('.json', '.xz')) or 'series' in name or 'codes' in name","tryCatchPattern":null,"preventionTips":["Pass explicit .json/.xz filenames instead of relying on auto-suffixing","Centralize asset-name construction in one helper"],"tags":["bls","assets","validation","file-not-supported"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}