Skip to content

Recieving raise ValueError("Invalid type for batch_request_content.") when posting a BatchRequestContentCollection #836

Closed

Description

@GeorgeOG

Describe the bug

Just run batch request with more than 20 Items.

I think this is because the "finalize" method of BatchRequestContent returns self._requests instead of self - this is later used when constructing a new BatchRequestContent when adding items to a BatchRequestContentCollection.

Expected behavior

runs without error

How to reproduce

send batch request with more than 20 items

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

can manually fix batches like so:

attachment_batch.batches = [
    batch if isinstance(batch, BatchRequestContent) else BatchRequestContent(batch)
    for batch in attachment_batch.batches
]

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Activity

  1. added
    status:waiting-for-triage
    type:bug
    on Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WIPstatus:waiting-for-triagetype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions