boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
9.08k stars 1.87k forks source link

Lakeformation list_permission does not implement a paginator #3932

Closed theister closed 1 year ago

theister commented 1 year ago

Describe the bug

lakeformation / list-permissions is a paginated API call that uses the standard pagination api using MaxResults & NextToken.

Unlike other methods of the lakeformation client, it is not possible to call it using a boto3 paginator, which makes writing code around that api call a pain that requires a lot of boilerplate as a workaround.

Expected Behavior

The method returns a paginator.

Current Behavior

Boto returns the error/stacktrace:

  File ".../python-3.11/lib/python3.11/site-packages/botocore/client.py", line 1121, in get_paginator
    raise OperationNotPageableError(operation_name=operation_name)

botocore.exceptions.OperationNotPageableError: Operation cannot be paginated: list_permissions

Reproduction Steps

(within a valid aws session)

import boto3
lf_client = boto3.client("lakeformation")
paginator = lf_client.get_paginator("list_permissions")

Possible Solution

Implement a boto paginator for all lakeformation api calls that need to be called paginated.

Additional Information/Context

No response

SDK version used

boto3==1.28.82 botocore==1.31.82

Environment details (OS name and version, etc.)

python 3.11.5

RyanFitzSimmonsAK commented 1 year ago

Hi @theister, thanks for reaching out. It looks like there is an issue with the model file that affects a couple Lake Formation operations. I've reached out to the service team regarding this. In the meantime, as this is an issue relevant to several SDKs, I'm going to close this issue and create a new one in our cross-SDK repository (https://github.com/aws/aws-sdk/issues/643). Please refer to that issue for any updates. Thanks!

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.