Skip to content

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

@GeorgeOG

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_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions