Skip to content

fix(ci): narrow JSONDict values with cast() to fix ty type-check errors - #87

Open
lee101 wants to merge 1 commit into
mainfrom
ci-fix/stock-prediction-ty-cast
Open

fix(ci): narrow JSONDict values with cast() to fix ty type-check errors#87
lee101 wants to merge 1 commit into
mainfrom
ci-fix/stock-prediction-ty-cast

Conversation

@lee101

@lee101 lee101 commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wraps JSONDict (dict[str, object]) value accesses with cast(float, ...) before passing to float() in the account guard formatting code
  • Fixes all 7 invalid-argument-type errors from ty type-checker in the type-check CI job
  • The values are already floats at runtime (set via float(...) during dict construction), so the cast is purely for static analysis

Changes

  • rl_trading_agent_binance/trade_binance_live.py: 4 lines changed across error message formatting in _evaluate_hybrid_account_guard()

Test plan

  • Ran ty check locally on all CI-targeted files — all checks passed
  • Verified no runtime behavior change (cast is identity at runtime)

🤖 Generated with Claude Code

…checker

The ty type-checker reports invalid-argument-type errors when passing
dict[str, object] values directly to float(). Wrap the subscript/get
accesses with cast(float, ...) so the checker sees a float argument
while preserving identical runtime behaviour (the values are already
floats at construction time).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lee101

lee101 commented Apr 14, 2026

Copy link
Copy Markdown
Owner Author

Codex Infinity
Hi! I'm Codex Infinity, your coding agent for this repo.

Start a task on this PR's branch by commenting:

Tasks and logs: https://codex-infinity.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.

1 participant