fix: remove unsupported Cassandra batch size kwarg#13557
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR fixes issue ChangesCassandra batch_size parameter removal
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
src/lfx/tests/unit/components/cassandra/test_cassandra_vector_store_component.py (1)
10-40: ⚡ Quick winConsider verifying that critical parameters are still correctly passed.
The test correctly validates that
batch_sizeis not passed toCassandra.from_documents()(the main PR objective). However, verifying that other critical parameters—especiallydocumentsandembedding—are still correctly forwarded would increase confidence that the fix doesn't inadvertently break existing functionality.✅ Enhancement: Add assertions for documents and embedding
assert "batch_size" not in captured_kwargs assert captured_kwargs["table_name"] == "test_table" assert captured_kwargs["keyspace"] == "test_keyspace" + assert "documents" in captured_kwargs + assert "embedding" in captured_kwargs🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lfx/tests/unit/components/cassandra/test_cassandra_vector_store_component.py` around lines 10 - 40, Add assertions to ensure documents and embedding are still forwarded to Cassandra.from_documents: after calling CassandraVectorStoreComponent().set(...).build_vector_store(), assert that captured_kwargs contains "documents" with the expected list (e.g., contains a Data instance with data {"text": "hello"}) and that "embedding" equals the MagicMock passed into component.set; keep the existing checks that "batch_size" is absent and "table_name"/"keyspace" are correct, referencing fake_from_documents, captured_kwargs, and CassandraVectorStoreComponent.build_vector_store to locate the test logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/lfx/tests/unit/components/cassandra/test_cassandra_vector_store_component.py`:
- Around line 10-40: Add assertions to ensure documents and embedding are still
forwarded to Cassandra.from_documents: after calling
CassandraVectorStoreComponent().set(...).build_vector_store(), assert that
captured_kwargs contains "documents" with the expected list (e.g., contains a
Data instance with data {"text": "hello"}) and that "embedding" equals the
MagicMock passed into component.set; keep the existing checks that "batch_size"
is absent and "table_name"/"keyspace" are correct, referencing
fake_from_documents, captured_kwargs, and
CassandraVectorStoreComponent.build_vector_store to locate the test logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 90be981b-7290-4faf-b6e4-5d8ff332a560
📒 Files selected for processing (3)
src/lfx/src/lfx/components/cassandra/cassandra.pysrc/lfx/tests/unit/components/cassandra/__init__.pysrc/lfx/tests/unit/components/cassandra/test_cassandra_vector_store_component.py
💤 Files with no reviewable changes (1)
- src/lfx/src/lfx/components/cassandra/cassandra.py
c7b4f6a to
8fb25a7
Compare
6282920 to
17602ea
Compare
Fixes #6255
Summary
batch_sizekwarg fromCassandra.from_documents(...)Verification
cd src/lfx && uv synccd src/lfx && uv run pytest tests/unit/components/cassandra/test_cassandra_vector_store_component.pycd src/lfx && uv run ruff format --check src/lfx/components/cassandra/cassandra.py tests/unit/components/cassandra/test_cassandra_vector_store_component.py tests/unit/components/cassandra/__init__.pycd src/lfx && uv run ruff check src/lfx/components/cassandra/cassandra.py tests/unit/components/cassandra/test_cassandra_vector_store_component.py tests/unit/components/cassandra/__init__.pySummary by CodeRabbit
Release Notes
Bug Fixes
Tests