Skip to content

[BUG] Async request signer doesn't work anymore #924

@JHeilCoveo

Description

@JHeilCoveo

What is the bug?

Since version 3.0.0 the AWSV4SignerAsyncAuth throws the following error :

AttributeError: 'bytes' object has no attribute 'items'

How can one reproduce the bug?

Minimal reproduction code.

import asyncio
import boto3
from opensearchpy import AsyncHttpConnection, AsyncOpenSearch, AWSV4SignerAsyncAuth


async def async_main() -> None:
    credentials = boto3.Session().get_credentials()
    auth = AWSV4SignerAsyncAuth(credentials, "us-east-1")
    client = AsyncOpenSearch(
        "http://localhost:9200",
        http_auth=auth,
        connection_class=AsyncHttpConnection,
    )

    await client.search(index="some-index", body={"query": "not_important"})


if __name__ == "__main__":
    asyncio.run(async_main())

The hostname doesn't need to exist. But you require a valid boto3 session.

What is the expected behavior?

Not throwing exception.

What is your host/environment?

Python 3.13 with opensearch-py[async] == 3.0.0

Do you have any screenshots?

Do you have any additional context?

I believe this regression has been introduced by #866 @brunomurino

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions