Files
OpenBB/openbb_platform/providers/sec/openbb_sec
Jason 4a594d0258 fix(sec): handle unexpected SEC API responses in cik_map (#7441)
* fix(sec): handle unexpected SEC API responses in cik_map and get_all_companies

Fixes #7097

The cik_map command throws 'ValueError: If using all scalar values,
you must pass an index' when the SEC API returns an unexpected response
format (e.g., flat dict instead of nested dict of dicts).

Changes:
- get_all_companies: validate response before DataFrame creation,
  use from_dict(orient='index') instead of DataFrame().transpose(),
  check column count matches expected fields
- cik_map fetcher: raise proper OpenBBError when symbol not found
  instead of returning empty dict that passes truthiness checks

* run black

---------

Co-authored-by: JasonOA888 <JasonOA888@users.noreply.github.com>
Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
2026-04-01 05:11:25 +00:00
..
2025-10-06 23:34:19 +00:00
2023-11-13 15:03:31 +00:00