Conversation
- Removed TaosWsDialect from taos/sqlalchemy.py and moved it to taos-ws-py/taosws/sqlalchemy.py for better separation of concerns. - Updated taos-ws-py/Cargo.toml to change the library name to _taosws for internal consistency. - Adjusted import paths in examples and tests to reflect the new module structure. - Added comprehensive tests for the taosws SQLAlchemy dialect to ensure compatibility and functionality. - Updated AGENTS.md to clarify project structure and development setup for taos-ws-py. - Removed deprecated taosws tests from the main test suite and integrated them into the new taos-ws-py test structure.
There was a problem hiding this comment.
Code Review
This pull request refactors the WebSocket connector into a standalone package, taos-ws-py, which involves moving the TaosWsDialect and its associated tests. The reviewer identified significant code duplication between the new taosws/sqlalchemy.py and the existing taos/sqlalchemy.py, suggesting the extraction of shared logic into a common module. Additional feedback includes updating the newly added AGENTS.md to reflect the current architecture, adding documentation for complex path manipulation in __init__.py, and replacing custom test helper functions with standard Python assert statements to improve readability.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
=======================================
Coverage 82.00% 82.00%
=======================================
Files 24 24
Lines 3717 3717
=======================================
Hits 3048 3048
Misses 669 669 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
此 PR 旨在将 taosws:// 的 SQLAlchemy 方言与测试从主 taospy 包中剥离,迁移到独立的 taos-ws-py(taosws)包内,并配套调整 WebSocket 连接器的 Python/Rust 模块封装与入口点注册方式。
Changes:
- 将
TaosWsDialect从taos/sqlalchemy.py移除,并在taos-ws-py/taosws/sqlalchemy.py新增实现,同时把 SQLAlchemy entry-point 注册迁移到taos-ws-py/pyproject.toml - 将 taosws 的 SQLAlchemy 测试从
tests/test_sqlalchemy.py移至taos-ws-py/tests/,并新增迁移校验用例 - 将 Rust 原生扩展模块更名为
_taosws,新增taosws/__init__.py作为 Python 包封装层,并更新 schemaless 相关导入路径
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_sqlalchemy.py | 移除 taosws SQLAlchemy 测试入口,保留 taos/taosrest 覆盖 |
| taos/sqlalchemy.py | 删除 TaosWsDialect(WebSocket 方言)实现 |
| pyproject.toml | 移除根工程对 taosws 的 SQLAlchemy 插件注册 |
| taos-ws-py/pyproject.toml | 新增 taos-ws-py 的打包配置与 taosws SQLAlchemy entry-point |
| taos-ws-py/taosws/sqlalchemy.py | 新增 TaosWsDialect(WebSocket 方言)实现 |
| taos-ws-py/tests/test_sqlalchemy.py | 新增/迁移 taosws SQLAlchemy 集成测试 |
| taos-ws-py/tests/test_sqlalchemy_migration.py | 新增方言迁移与依赖隔离校验测试 |
| taos-ws-py/src/lib.rs | 将 PyO3 模块名改为 _taosws 并同步异常注册命名空间 |
| taos-ws-py/Cargo.toml | Rust crate 名称改为 _taosws |
| taos-ws-py/taosws/init.py | 新增 Python 包封装层,尝试加载 _taosws 并导出符号 |
| taos-ws-py/tests/test_schemaless.py | 更新 schemaless 导入为 from taosws import ... |
| taos-ws-py/examples/schemaless_example.py | 同步更新示例导入路径 |
| AGENTS.md | 新增开发者指南(但当前内容与本 PR 变更存在不一致) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… SQLAlchemy dialect
6b62834 to
e4646e3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… encoding in SQLAlchemy dialect tests
- Adjusted requests and black dependencies to support specific Python versions. - Updated pandas and sqlalchemy dependencies to ensure compatibility. - Removed unnecessary newline in test_taospy.sh for cleaner script execution.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 23 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.