Skip to content

fix(python): match the type stubs to the real CostModel and broker bindings - #79

Merged
ricardofrantz merged 1 commit into
mainfrom
feat/execution-records
Nov 13, 2026
Merged

ricardofrantz merged 1 commit into
mainfrom
feat/execution-records

Conversation

@ricardofrantz

@ricardofrantz ricardofrantz commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Found while checking the reference in #78.

  • CostModel.__init__: the binding is (commission_bps: float = 0.0, slippage_bps: float = 0.0, min_commission: int = 0) (python/src/portfolio.rs:31). The stub had int bps and min_trade_fee, so type checkers flagged correct calls and accepted a keyword that raises TypeError.
  • IbkrBroker.open_orders and BinanceBroker.open_orders: no such method in python/src; removed from the stub.

View guided diff Turn on auto-fix

…ndings

CostModel takes float commission_bps and slippage_bps and an int
min_commission (python/src/portfolio.rs:31); the stub still had int
fields and min_trade_fee, so type checkers rejected correct calls.
Neither Python broker binds open_orders; the stub declared it.

Co-authored-by: Ricardo Frantz <4220623+ricardofrantz@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c26342b and 7359163.

Files selected for processing: 1

  • python/nanobook.pyi
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@ricardofrantz
ricardofrantz merged commit fabba5d into main Nov 13, 2026
28 checks passed
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