Remove unused imports#895
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (57)
💤 Files with no reviewable changes (26)
✅ Files skipped from review due to trivial changes (21)
🚧 Files skipped from review as they are similar to previous changes (10)
📝 WalkthroughWalkthroughThis pull request removes unused imports across runtime modules and test modules, including standard-library imports, Cassandra driver symbols, and integration test helpers. It also keeps a few module-level imports in place with 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
CI summaryAll checks relevant to this change are green. The matrix result:
Why
|
e5c83c3 to
9116334
Compare
Summary
Removes unused imports across the driver and the test suite, split into two commits:
cassandra/packagetests/Detected with
ruff --select F401.Notes on preserved imports
The following "unused" imports were intentionally kept, because they are not truly unused:
cassandra/protocol.pyresolves 21 cqltype classes by name viaglobals()[name]to buildResultMessage.type_codes. Removing them breaks import withKeyError. Kept with a# noqa: F401block and an explanatory comment.cassandra/connection.pyre-exportsShardingInfo(consumed viafrom cassandra.connection import ShardingInfo, e.g.tests/unit/test_shard_aware.py). Kept with# noqa: F401.try/except ImportErrorused to detect optional dependencies (kerberos,numpy,cryptography,gremlin_python,ccmlib.common,make_recv_results_rows).cassandra/datastax/graph/__init__.py.Testing
build_ext --inplace/uv sync --reinstall-package scylla-driver) so the edited.pysources are actually exercised.test_cluster.pyfailures unrelated to this change; reactor-timer tests excluded as they hang in the sandbox).