Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stepfunctions] nextToken should not be required in output type #318

Open
taesungh opened this issue Oct 22, 2024 · 3 comments
Open

[stepfunctions] nextToken should not be required in output type #318

taesungh opened this issue Oct 22, 2024 · 3 comments
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter

Comments

@taesungh
Copy link

Similar to #238, the type definitions for the responses of some of the methods on the AWS Step Functions client specify nextToken as required in the TypedDict when it is not always returned.

For example, here is GetExecutionHistoryOutputTypeDef (for get_execution_history)

GetExecutionHistoryOutputTypeDef = TypedDict(
    "GetExecutionHistoryOutputTypeDef",
    {
        "events": List["HistoryEventTypeDef"],
        "nextToken": str,
        "ResponseMetadata": "ResponseMetadataTypeDef",
    },
)

and this also applies to ListExecutionsOutputTypeDef and a few other output types

Example query and response

There may be multiple pages for execution history,

import boto3
sfn_client = boto3.client("stepfunctions")
history = sfn_client.get_execution_history(executionArn="arn:...")

but the response doesn't include nextToken when there are no more pages.

{
    "events": [
        { ... },
    ],
    "ResponseMetadata": { ... },
}

Additional context

Referencing mypy-boto3-stepfunctions v1.35.9

@taesungh taesungh added the 🐞 bug Something isn't working label Oct 22, 2024
@vemel
Copy link
Collaborator

vemel commented Oct 23, 2024

Hello! Thank you for the report.

I already have a list of keys that should not be marked as required in output shapes. I can mark nextToken as Optional as well. I will check how many services are affected.

As far as I know, botocore team tries to follow the same pagination pattern for all services, but we will see.

@vemel
Copy link
Collaborator

vemel commented Oct 23, 2024

Actually, as I see NextToken is already marked as NotRequired, but nextToken is not :) So, not all services follow the same pagination pattern.

@vemel
Copy link
Collaborator

vemel commented Oct 23, 2024

Fixed in mypy-boto3-builder 8.1.3. Also, I released mypy-boto3-stepfunctions 1.35.46 with the fix included. Please update and let me know if it works as expected.

@vemel vemel added 👋 response needed Awaiting response from a reporter 🎉 released Changes were included to the latest release labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter
Projects
None yet
Development

No branches or pull requests

2 participants