Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for string payloads in the query parser functions to handle Postgres protocol metadata queries. Previously, the parser functions expected dictionary/object payloads and would fail when receiving strings. The changes ensure that string payloads are gracefully converted to empty objects, allowing the functions to return empty results instead of raising errors.
- Added
_ensure_dict_payloadhelper in Python andensureObjectPayloadhelper in JavaScript to validate and normalize payloads - Updated all public parser functions to accept
Union[Dict[str, Any], str](Python) or handle string payloads (JavaScript) - Added comprehensive test coverage for string payload handling across all parser functions
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cube_utils/query_parser.py | Added payload validation helper and updated function signatures to accept string payloads |
| cube-utils-js/src/query-parser.js | Added JavaScript equivalent payload validation helper and updated all parser functions |
| tests/test_query_parser.py | Added test cases for string payload handling in all parser functions |
| cube-utils-js/test/query-parser.test.js | Added JavaScript test cases for string payload handling |
| pyproject.toml | Bumped version to 0.1.9 |
| cube-utils-js/package.json | Bumped version to 0.1.9 |
| feature_plans/validate_payloads.md | Added feature plan documentation for Python implementation |
| feature_plans/validate_payloads_js.md | Added feature plan documentation for JavaScript implementation |
| CLAUDE.md | Updated documentation with reference to AGENTS.md |
| AGENTS.md | Added project guidelines for maintaining consistency across implementations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Query_rewrite can now receive string payloads; we should accept and ignore them. Str payloads are Postgres protocol metadata queries.