Repository navigation
chore(format): ruff python files - #723
Conversation
|
Important Review skippedToo many files! This PR contains 255 files, which is 105 over the limit of 150. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (255)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
No description provided. |
68e4f1c to
f9f6f15
Compare
6df210e to
b7a26ef
Compare
f9f6f15 to
11805ea
Compare
744816c to
b4b5f3d
Compare
aefdddd to
02c7267
Compare
02c7267 to
a632507
Compare
Mirrors rocketride-org#900. These three pre-existing files on develop drifted out of `ruff format --check` after PR rocketride-org#723's cleanup; including the fix here so this PR's CI `ruff-check` (and the `CI OK` gatekeeper that depends on it) goes green without waiting for rocketride-org#900 to merge first. Pure mechanical `ruff format` output — line-break reformatting only, no semantic changes. If rocketride-org#900 merges first, this commit becomes a no-op on rebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors rocketride-org#900. These three pre-existing files on develop drifted out of `ruff format --check` after PR rocketride-org#723's cleanup; including the fix here so this PR's CI `ruff-check` (and the `CI OK` gatekeeper that depends on it) goes green without waiting for rocketride-org#900 to merge first. Pure mechanical `ruff format` output — line-break reformatting only, no semantic changes. If rocketride-org#900 merges first, this commit becomes a no-op on rebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors rocketride-org#900. These three pre-existing files on develop drifted out of `ruff format --check` after PR rocketride-org#723's cleanup; including the fix here so this PR's CI `ruff-check` (and the `CI OK` gatekeeper that depends on it) goes green without waiting for rocketride-org#900 to merge first. Pure mechanical `ruff format` output — line-break reformatting only, no semantic changes. If rocketride-org#900 merges first, this commit becomes a no-op on rebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(nodes): add Cohere Rerank pipeline node Adds a `rerank_cohere` pipeline node that slots between vector search and the LLM in RAG pipelines, improving answer quality by reranking retrieved documents by relevance to the query. Components: - RerankClient — wraps Cohere ClientV2 with top_n/min_score validation and an exception hierarchy (RerankAuthenticationError, RerankRateLimitError, RerankBadRequestError, RerankServerError) named for circuit-breaker substring heuristics. - IGlobal — standard validateConfig (no live API call) and beginGlobal lifecycle, with depends() for SDK auto-install. - IInstance — deep-copies question (fan-out safe), maps rerank result indices back through original document positions so metadata stays aligned when min_score filters blank docs, always emits an answer. - services.json — rerank-v3.5 (default), rerank-english-v3.0, custom profiles; top_n and min_score exposed in all preset shapes. Resubmission of the rerank portion of closed PR #499 per maintainer feedback: one PR per node, clean branch from develop, no unrelated file changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(format): apply ruff format to llm_vision_* files Mirrors #900. These three pre-existing files on develop drifted out of `ruff format --check` after PR #723's cleanup; including the fix here so this PR's CI `ruff-check` (and the `CI OK` gatekeeper that depends on it) goes green without waiting for #900 to merge first. Pure mechanical `ruff format` output — line-break reformatting only, no semantic changes. If #900 merges first, this commit becomes a no-op on rebase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(rerank_cohere): harden validation, mark experimental, default to v3.0 - services.json: mark capabilities=["experimental"] (stepmikhaylov CR-1) - services.json: default preset rerank-english-v3.0 (CodeRabbit nit) - services.json: add requires=["ROCKETRIDE_RERANK_COHERE_KEY"] on test block so missing keys skip dynamic tests cleanly (stepmikhaylov CR-6) - rerank_client.py: accept int|float for top_n (excluding bool) and coerce JSON 5.0 -> 5; same bool-exclusion for min_score; centralized in _coerce_top_n / _validate_min_score helpers (stepmikhaylov CR-7 + CodeRabbit non-bool int check) - IGlobal.py: validateConfig rejects non-str/whitespace-only apikey and model before .strip() (CodeRabbit) - IInstance.py: trim query/document strings before emptiness checks so whitespace-only payloads are rejected (CodeRabbit) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(rerank_cohere): relocate to nodes/test/rerank_cohere/test_all.py Per repo convention for node-specific unit tests. Stops mocking engine-level modules (rocketlib, ai.*, depends) and drops the sys.path.insert hack — IGlobal/IInstance are imported through the build interpreter that already provides them, matching guardrails and astra_db. The external cohere SDK is the only dependency mocked, sourced from the canonical nodes/test/mocks/cohere/ package. The mock is loaded via a scoped sys.path so other tests are not contaminated. Additional coverage: - top_n: accepts JSON float 5.0 (coerced to int), rejects 2.5 and bool - min_score: rejects bool (subclass of int) at init and override - validateConfig: rejects non-string apikey/model before .strip() - IInstance: whitespace-only query and whitespace-only page_content raise ValueError Addresses stepmikhaylov CR-2..CR-5 and CodeRabbit nit re patch.dict. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(rerank_cohere): supply required DocMetadata fields in IInstance tests Three IInstance tests (test_write_questions_preserves_metadata, test_write_questions_metadata_alignment_after_filter, test_write_questions_does_not_mutate_original) constructed Doc objects with metadata dicts missing the required chunkId (and in one case objectId) fields. The build interpreter's real pydantic DocMetadata schema requires both, so the tests failed with ValidationError under builder nodes:test even though they passed locally with the cohere mock. Also tighten the dict-equality assertion to attribute-level since DocMetadata is a pydantic model, not a dict. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(rerank_cohere): harden runtime input validation in RerankClient.rerank Reject non-string and whitespace-only query/documents/model values before calling the Cohere SDK, so callers get a deterministic local ValueError instead of RerankBadRequestError/RerankServerError from the network. This keeps the wrapper's stable validation contract aligned with the existing validateConfig hardening. Addresses CodeRabbit review on PR #898. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Format Python files using Ruff to meet mandatory CI/CD checks