Skip to content

Document build_full_result contract and log dropped members - #3767

Open
jonathan343 wants to merge 1 commit into
developfrom
pagination-debug
Open

Document build_full_result contract and log dropped members#3767
jonathan343 wants to merge 1 commit into
developfrom
pagination-debug

Conversation

@jonathan343

Copy link
Copy Markdown
Contributor

Summary

PageIterator.build_full_result() silently drops any top-level output member that isn't a result_key or non_aggregate_key. This PR adds a docstring describing the aggregation contract and a DEBUG log naming dropped members, so users who hit a missing field get a breadcrumb instead of debugging a silent omission.

Background

build_full_result() collapses a paginated response into a single dict, aggregating only result_key values (summed across pages) and members listed in non_aggregate_keys (supplied per-service via paginators-1.sdk-extras.json overlays). Everything else is dropped from the final response. We maintained those overlays strictly because AWS CLI v1 shared our release stack and enforced pagination validation due to it's auto-pagination requirements. CLI v1 now vendors its own botocore, so this improves the experience for the remaining direct build_full_result() callers without requiring per-service customizations.

Customer experience

No behavior change. A user hitting a missing field in the future now gets a DEBUG breadcrumb (visible under boto3.set_stream_logger('')) naming the dropped members.

2026-08-05 17:29:21,194 botocore.paginate [DEBUG] The following top-level output members are not accounted for in the pagination config and were dropped from build_full_result: RequestId, Status. Iterate the pages directly if you need these values.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

build_full_result only aggregates result_keys and non_aggregate_keys;
other top-level output members are silently dropped. Document this and
emit a DEBUG log naming dropped members so callers can spot missing
fields instead of debugging a mystery.
@jonathan343
jonathan343 requested a review from a team as a code owner August 5, 2026 21:43

@Alan4506 Alan4506 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @jonathan343! LGTM overall but I have a question. Please see my comment below.

Comment thread botocore/paginate.py
if dropped:
log.debug(
"The following top-level output members are not "
"accounted for in the pagination config and were dropped "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I'm wondering if the wording "not accounted for in the pagination config" is accurate or not. For example, IAM ListUsers declares IsTruncated as more_results in its pagination config, but since it never lands in the merged result, the log shows:

The following top-level output members are not accounted for in the
pagination config and were dropped from build_full_result: IsTruncated.
Iterate the pages directly if you need these values.

I agree that IsTruncated is dropped from build_full_result, but it is indeed accounted for in the paginator config, right?

Correct me if my understanding is wrong.

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