chore(wren-ai-service): update query sql api endpoint#1647
Conversation
WalkthroughThe changes update the API endpoint version from "v2" to "v3" for connector query requests across multiple modules and a test file. In one instance, the "limit" key is also removed from the POST payload. No changes are made to function signatures or exported entities. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Service
participant ConnectorAPI
Caller->>Service: Initiate SQL query (non-duckdb)
Service->>ConnectorAPI: POST /v3/connector/{data_source}/query
ConnectorAPI-->>Service: Query result
Service-->>Caller: Return result
Suggested reviewers
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
wren-ai-service/eval/utils.py (1)
63-66: Verifylimithandling and URL construction
The code now appendslimitas a query parameter (?limit={limit}) and omits it from the JSON payload. Please confirm that the v3 API expectslimitin the URL rather than in the body. For greater robustness and readability, consider usingurllib.parse.urlencodeoryarl.URLto build URLs instead of manual string concatenation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
wren-ai-service/eval/data_curation/utils.py(1 hunks)wren-ai-service/eval/utils.py(1 hunks)wren-ai-service/src/providers/engine/wren.py(1 hunks)wren-ai-service/tests/pytest/eval/test_metrics.py(1 hunks)wren-ai-service/tools/run_sql.py(1 hunks)
🔇 Additional comments (5)
wren-ai-service/eval/data_curation/utils.py (1)
69-69: API endpoint version updated successfullyThe update from v2 to v3 in the connector query endpoint aligns with the PR objective to fix run-sql functionality.
wren-ai-service/src/providers/engine/wren.py (1)
118-118: API endpoint version updated correctlyThe endpoint version for connector queries has been properly updated from v2 to v3, consistent with the changes in other files.
wren-ai-service/tests/pytest/eval/test_metrics.py (1)
70-70: Test mock endpoint correctly updatedThe test mock has been properly updated to use the v3 endpoint, maintaining consistency with the implementation code changes.
wren-ai-service/tools/run_sql.py (1)
83-89: API endpoint version updated properlyThe connector query endpoint has been correctly updated from v2 to v3. Additionally, the "limit" parameter is now included in the URL query string instead of the JSON payload, which is consistent with the PR's objective.
wren-ai-service/eval/utils.py (1)
63-63: Version bump for connector query endpoint
The connector query path has been updated from/v2/connector/{data_source}/queryto/v3/connector/{data_source}/query, aligning with the rest of the codebase.
Summary by CodeRabbit