Skip to content

Refactor response parsing in _parse_response to handle single and mul…#6

Merged
harell merged 1 commit intomasterfrom
feature/reduce-duplicated-code
Sep 25, 2025
Merged

Refactor response parsing in _parse_response to handle single and mul…#6
harell merged 1 commit intomasterfrom
feature/reduce-duplicated-code

Conversation

@harell
Copy link
Contributor

@harell harell commented Sep 25, 2025

…tiple DocumentDetails objects

Copilot AI review requested due to automatic review settings September 25, 2025 03:51
@harell harell merged commit db795ca into master Sep 25, 2025
13 checks passed
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 refactors the response parsing logic in the _parse_response function to handle both single DocumentDetails objects and lists of DocumentDetails objects more robustly. The change improves the function's ability to parse API responses that may return either a single document or multiple documents.

  • Replaced hardcoded list processing with type-checking logic that handles both dict and list responses
  • Added explicit handling for single document responses by wrapping them in a list for consistent return type
  • Included fallback logic to return None for unexpected response formats

@harell harell deleted the feature/reduce-duplicated-code branch September 25, 2025 03:52
@t-t-sonarqube
Copy link

t-t-sonarqube bot commented Sep 25, 2025

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