Conversation
📝 WalkthroughWalkthroughThe changes relocate the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/test_acceptance.py`:
- Around line 176-178: Add a type annotation for the variadic kwargs in
create_test_run: change the signature of create_test_run to annotate **kwargs as
typing.Any (or Mapping[str, Any]) and import Any from typing at the top of the
file so static analysis recognizes the type for forwarded TestRun fields like
time_limit; keep the rest of the function unchanged and ensure the import is
added to the existing typing imports.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0656b233-29d3-4fa4-be8f-8a0664ea8ea9
📒 Files selected for processing (4)
src/cloudai/workloads/megatron_bridge/megatron_bridge.pysrc/cloudai/workloads/megatron_bridge/slurm_command_gen_strategy.pytests/ref_data/megatron-bridge.sbatchtests/test_acceptance.py
💤 Files with no reviewable changes (1)
- src/cloudai/workloads/megatron_bridge/megatron_bridge.py
| def create_test_run(partial_tr: partial[TestRun], name: str, test_definition: TestDefinition, **kwargs) -> TestRun: | ||
| tr = partial_tr(name=name, test=test_definition, **kwargs) | ||
| return tr |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
LGTM! Consider adding type annotation for **kwargs.
The **kwargs passthrough pattern correctly allows forwarding additional TestRun fields (like time_limit) to the partial constructor. This is a clean approach to support the new time_limit handling without modifying every test case.
The static analysis flags a missing type annotation for **kwargs. This is a minor improvement that could enhance clarity:
🔧 Optional: Add type annotation
-def create_test_run(partial_tr: partial[TestRun], name: str, test_definition: TestDefinition, **kwargs) -> TestRun:
+def create_test_run(partial_tr: partial[TestRun], name: str, test_definition: TestDefinition, **kwargs: Any) -> TestRun:This would require adding Any to the imports from typing.
🧰 Tools
🪛 Ruff (0.15.6)
[warning] 176-176: Missing type annotation for **kwargs
(ANN003)
[warning] 178-178: Unnecessary assignment to tr before return statement
Remove unnecessary assignment
(RET504)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/test_acceptance.py` around lines 176 - 178, Add a type annotation for
the variadic kwargs in create_test_run: change the signature of create_test_run
to annotate **kwargs as typing.Any (or Mapping[str, Any]) and import Any from
typing at the top of the file so static analysis recognizes the type for
forwarded TestRun fields like time_limit; keep the rest of the function
unchanged and ensure the import is added to the existing typing imports.
Summary
Manage
time_limitconsistently with other workloads viaTestRun.time_limitTest Plan
Additional Notes