Skip to content

fix: annotate get_fundamentals_data return type as dict (#71)#72

Open
alexpipipi wants to merge 1 commit into
mainfrom
fix/fundamentals-return-type
Open

fix: annotate get_fundamentals_data return type as dict (#71)#72
alexpipipi wants to merge 1 commit into
mainfrom
fix/fundamentals-return-type

Conversation

@alexpipipi

Copy link
Copy Markdown
Contributor

Closes #71 (reported by @AnthonyTedde).

/api/fundamentals/{ticker} returns a JSON object, but get_fundamentals_data (and get_fundamentals_data_v1_1, which has the same bug) were annotated -> list. This produces misleading IDE hints and type-checker errors.

Change

  • get_fundamentals_data and get_fundamentals_data_v1_1: -> list-> dict
  • Added a regression test asserting both return annotations are dict

Verification

  • Live API call through the library: get_fundamentals_data('AAPL.US') returns dict with keys General, Highlights, Valuation, ...
  • pytest: ✅ 66 passed

🤖 Generated with Claude Code

The /api/fundamentals/{ticker} endpoint returns a JSON object (keys like
General, Highlights, Valuation, ...), but get_fundamentals_data and
get_fundamentals_data_v1_1 were annotated `-> list`, producing misleading
type hints and type-checker errors for users.

Changed both annotations to `-> dict` and added a regression test asserting
the return annotation. Verified against the live API: AAPL.US fundamentals
returns a dict.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_fundamentals_data should return dict, not list

1 participant