-
Notifications
You must be signed in to change notification settings - Fork 1
support all catboost versions. #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@aryehlev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 20 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis PR introduces version-aware CatBoost library download selection in the build script with dynamic feature-flag emission based on library version. The Model implementation adds conditional compilation guards to support embeddings and text features only when the underlying library version provides them, with fallback error handling. Changes
Sequence Diagram(s)sequenceDiagram
participant Build as build.rs
participant Cargo as Cargo
participant Compile as Compile Time
participant Runtime as Runtime
Build->>Build: Parse CatBoost version
alt Version >= 1.2
Build->>Build: Detect supported features
note over Build: catboost_embeddings,<br/>catboost_text_count, etc.
else Version < 1.2
Build->>Build: Limited feature set
end
Build->>Cargo: Emit cfg flags
Cargo->>Compile: Feature gates active
Compile->>Compile: Conditional compilation<br/>#[cfg(...)] blocks
Compile->>Runtime: Binary with<br/>feature-aware paths
Runtime->>Runtime: predict() calls embedding-aware<br/>or fallback implementation<br/>based on cfg
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Areas requiring extra attention:
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
build.rs(2 hunks)src/model.rs(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/model.rs (1)
src/error.rs (1)
check_return_value(15-21)
| "catboostmodel.dll".to_string(), | ||
| format!( | ||
| "https://github.com/catboost/catboost/releases/download/v{}/catboostmodel.dll", | ||
| version | ||
| ), | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Windows download URL for v1.2+ artifacts.
For CatBoost releases v1.2 and newer, the Windows assets are renamed to catboostmodel-windows-{cpu_arch}-{release_version}.dll. The current URL (.../catboostmodel.dll) no longer exists, so every Windows build on these versions will fail with a 404. Please switch to the versioned/arch-specific filename before shipping.(catboost.ai)
Apply this diff to correct the URL:
- ("windows", "x86_64") => (
- "catboostmodel.dll".to_string(),
- format!(
- "https://github.com/catboost/catboost/releases/download/v{}/catboostmodel.dll",
- version
- ),
- ),
+ ("windows", arch) if arch == "x86_64" => (
+ "catboostmodel.dll".to_string(),
+ format!(
+ "https://github.com/catboost/catboost/releases/download/v{}/catboostmodel-windows-{}-{}.dll",
+ version,
+ arch,
+ version
+ ),
+ ),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "catboostmodel.dll".to_string(), | |
| format!( | |
| "https://github.com/catboost/catboost/releases/download/v{}/catboostmodel.dll", | |
| version | |
| ), | |
| ), | |
| ("windows", arch) if arch == "x86_64" => ( | |
| "catboostmodel.dll".to_string(), | |
| format!( | |
| "https://github.com/catboost/catboost/releases/download/v{}/catboostmodel-windows-{}-{}.dll", | |
| version, | |
| arch, | |
| version | |
| ), | |
| ), |
🤖 Prompt for AI Agents
In build.rs around lines 107 to 112, the Windows download URL currently points
to "catboostmodel.dll" which no longer exists for CatBoost v1.2+; update the
filename and URL to the new convention
"catboostmodel-windows-{cpu_arch}-{release_version}.dll" (i.e. use the build's
CPU architecture variable and the existing version variable in the URL format
string) so the format becomes something like
"https://github.com/catboost/catboost/releases/download/v{version}/catboostmodel-windows-{cpu_arch}-{version}.dll";
ensure you derive the {cpu_arch} value from the build target (e.g., x86_64,
aarch64) used elsewhere in the script and plug it into both the local filename
and the download URL.
Summary by CodeRabbit
Release Notes
New Features
Chores