Skip to content

Fix str payload#9

Merged
paco-valdez merged 4 commits intomainfrom
fix-str-payload
Oct 22, 2025
Merged

Fix str payload#9
paco-valdez merged 4 commits intomainfrom
fix-str-payload

Conversation

@paco-valdez
Copy link
Owner

Query_rewrite can now receive string payloads; we should accept and ignore them. Str payloads are Postgres protocol metadata queries.

@paco-valdez paco-valdez requested a review from Copilot October 22, 2025 20:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_payload helper in Python and ensureObjectPayload helper 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.

@paco-valdez paco-valdez requested a review from Copilot October 22, 2025 20:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@paco-valdez paco-valdez merged commit 9bdf978 into main Oct 22, 2025
6 checks passed
@paco-valdez paco-valdez deleted the fix-str-payload branch October 22, 2025 20:44
@paco-valdez paco-valdez restored the fix-str-payload branch October 22, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants