Skip to content

Response envelope type hints #242

Open
@willshang76

Description

@willshang76

When I use the sync client like below

from notion_client import Client

self.notion_token = notion_token or os.environ.get("NOTION_TOKEN")

self.notion_client = Client(auth=self.notion_token)

response = self.notion_client.search(
    filter={"property": "object", "value": "page"},
    start_cursor=cursor,
)
all_pages_info.extend(response["results"])

The mypy check complains 'Value of type "Any | Awaitable[Any]" is not indexable' for the line response = self.notion_client.search and all_pages_info.extend(response["results"]).

I wonder how to solve this. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededtaskSomething that has to be done at some point

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions