SDK-2792: Python - Add support for retrieving the extraction_image_ids field from the IDV pages - python#461
Open
mehmet-yoti wants to merge 1 commit into
Conversation
…age_ids field from the IDV pages [python]
Contributor
Author
🤖 Claude Code ReviewCode Review FindingsCriticalNone MajorNone Minor
Nit
|
|
There was a problem hiding this comment.
Pull request overview
Adds support in the Doc Scan session retrieval models for the new extraction_image_ids field on IDV page responses, allowing SDK consumers to access the list of media IDs used for automated extraction.
Changes:
- Parse
extraction_image_idsfrom page response data and expose it via a newPageResponse.extraction_image_idsproperty (defaults to[]when missing/None). - Extend and add unit tests to cover populated, empty, null, and absent
extraction_image_idscases. - Update the existing session fixture to include the new field on a page entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| yoti_python_sdk/doc_scan/session/retrieve/page_response.py | Adds parsing/storage + public property for extraction_image_ids. |
| yoti_python_sdk/tests/doc_scan/session/retrieve/test_page_response.py | Adds assertions and new tests covering extraction_image_ids scenarios. |
| yoti_python_sdk/tests/fixtures/response_get_docs_scan_session.txt | Updates the sample session response fixture to include extraction_image_ids. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "last_updated": "2020-01-30T15:00:00Z" | ||
| } | ||
| }, | ||
| "extraction_image_ids": ["066a9372-1ab9-49f0-b390-1b58e08f17f6"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds support for the new
extraction_image_idsfield on IDV page responses, exposing the list of media IDs used for automated extraction. The field is parsed from the document scan session response and returned via a new property onPageResponse, defaulting to an empty list when absent or null.Changes
yoti_python_sdk/doc_scan/session/retrieve/page_response.py: Parseextraction_image_idsfrom the raw data dict and expose it through a newextraction_image_idsproperty (list[str]). Defaults to[]when the field is missing orNone.yoti_python_sdk/tests/doc_scan/session/retrieve/test_page_response.py: Added assertions to existingtest_should_parse_correctlyandtest_should_parse_with_nonetests, plus four new tests covering single UUID, empty array, null value, and absent-field cases.yoti_python_sdk/tests/fixtures/response_get_docs_scan_session.txt: Addedextraction_image_idsarray to the fixture page entry to reflect the new API field.QA Test Steps
pip install -e .andpip install -r requirements.txt.PageResponsetests pass:python -m pytest yoti_python_sdk/tests/doc_scan/session/retrieve/test_page_response.py -vtest_should_parse_correctly,test_should_parse_with_none,test_should_parse_extraction_image_ids_with_single_uuid,test_should_parse_extraction_image_ids_with_empty_array,test_should_parse_extraction_image_ids_with_null,test_should_parse_extraction_image_ids_when_field_absent.python -m pytest yoti_python_sdk/tests/doc_scan/ -vPageResponse({}).extraction_image_idsshould return[](field absent).PageResponse({"extraction_image_ids": None}).extraction_image_idsshould return[](null).PageResponse({"extraction_image_ids": []}).extraction_image_idsshould return[](empty array).PageResponse(None).extraction_image_idsshould return[](no data at all).capture_method,media, andframesproperties onPageResponsestill behave as before when consuming the updated fixture inresponse_get_docs_scan_session.txt.extraction_image_idson pages and confirm the IDs are accessible viapage.extraction_image_idson eachPageResponse.Notes
frames(default to empty list when missing), and additionally guards against an explicitNonevalue viadata.get("extraction_image_ids") or [].list(...)to prevent external mutation of the underlying input dict's list reference.list[str]of media IDs; resolving those IDs to actual media still goes through existing media retrieval endpoints — no new fetch helper was added in this change.Related Jira: SDK-2792
Auto-generated by n8n + Claude CLI