Skip to content

[REX-3084] Add get_recommendation_page_results for the recommendations page endpoint - #103

Open
TimDumol wants to merge 6 commits into
Constructor-io:masterfrom
TimDumol:rex-3084-page-results
Open

TimDumol wants to merge 6 commits into
Constructor-io:masterfrom
TimDumol:rex-3084-page-results

Conversation

@TimDumol

@TimDumol TimDumol commented Oct 10, 2026 •

Copy link
Copy Markdown

Adds recommendations.get_recommendation_page_results(page_id, parameters, user_parameters) for GET /recommendations/v1/pages/{page_id} (API reference). A page returns all of its pods in one response, with each item appearing in at most one pod. Beta: the endpoint is available to a small group of users and may change.

  • Shared parameters use the same wire format as get_recommendation_results.
  • pod_overrides are sent as pod_overrides[<pod_id>][...]. An override replaces the page-wide value for that pod. Page-wide keys inside an override raise ConstructorException.
  • Each pod's result_id is stamped onto its results. Use pods[].result_id for tracking, not the top-level result_id.
  • get_recommendation_results is unchanged.

Testing

  • Mocked tests in tests/modules/test_recommendations_page.py
  • pylint and isort clean on changed files
  • A live test is added but skipped until the test index has a page configured

🤖 Generated with Claude Code

TimDumol and others added 5 commits October 10, 2026 20:29
…s page endpoint

Calls GET /recommendations/v1/pages/{page_id}. Shared parameters use the
same wire format as get_recommendation_results; pod_overrides are sent as
pod_overrides[<pod_id>][<param>] in bracket notation.

Each pod's own result_id is stamped onto that pod's results. The
top-level result_id identifies the page request and is not a tracking id.

get_recommendation_results is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rameters

Raise ConstructorException when a pod_overrides value is not a dictionary
instead of failing with an AttributeError or a misleading error. Add tests
for page-wide pre_filter_expression, variations_map and hidden_fields, and
shorten the skip reason on the live test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ace each other

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TimDumol
TimDumol marked this pull request as ready for review October 13, 2026 12:35
Copilot AI balanced review requested due to automatic review settings October 13, 2026 12:35
@TimDumol
TimDumol requested a review from a team as a code owner October 13, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Falsey non-dictionary pod override inputs currently bypass validation.

1 open finding
What changed in this PR

Adds beta support for retrieving all recommendation pods configured on a page.

Changes:

  • Adds page request serialization and per-pod overrides.
  • Stamps pod result IDs onto their results.
  • Adds mocked and skipped live tests.
File Description
constructor_io/​modules/​recommendations.py Implements the page endpoint and response processing.
tests/​modules/​test_recommendations_page.py Tests parameters, overrides, validation, and result IDs.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants