boto / boto3

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

Explanation of the freeze of resources development #4142

Closed SamStephens closed 4 months ago

SamStephens commented 4 months ago

Describe the issue

I just discovered via https://github.com/boto/boto3/issues/1068 that Resource interface has entered a feature freeze, so is effectively deprecated.

The note at the top of https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html provides no description of the rational, nor of what alternative will be provided in the future version where support is dropped entirely.

The lack of resources will be felt particularly for DynamoDB users, where the resource oriented interface handles a lot of conversion that has to be explicitly done using the low level interface, and is clearly superior for most use cases. As an example:

The definition of ExpressionAttributeValues from the Table resource version of query:

    ExpressionAttributeValues={
        'string': 'string'|123|Binary(b'bytes')|True|None|set(['string'])|set([123])|set([Binary(b'bytes')])|[]|{}
    }

The definition of ExpressionAttributeValues from the client version of query:

    ExpressionAttributeValues={
        'string': {
            'S': 'string',
            'N': 'string',
            'B': b'bytes',
            'SS': [
                'string',
            ],
            'NS': [
                'string',
            ],
            'BS': [
                b'bytes',
            ],
            'M': {
                'string': {'... recursive ...'}
            },
            'L': [
                {'... recursive ...'},
            ],
            'NULL': True|False,
            'BOOL': True|False
        }
    }

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html

tim-finnigan commented 4 months ago

Hi @SamStephens — to clarify, the feature freeze on resources is not a deprecation. As mentioned in the note on that resources documentation page, the resources interface will continue to operate during Boto3’s lifecycle:

The AWS Python SDK team does not intend to add new features to the resources interface in boto3. Existing interfaces will continue to operate during boto3’s lifecycle. Customers can find access to newer service features through the client interface.

Also in the comment you referenced:

We’d like to highlight that all existing code using resources is supported and will continue to work in Boto3. No action is needed from users of the library.

We recommend using the DynamoDB client interface for access to newer service features which you can track in the CHANGELOG.

Feature requests related to the Boto3 resources interface are not prioritized because we are striving for more consistency among the AWS SDKs, so efforts involving new functionality in high-level interfaces would be better directed towards longer term cross-SDK solutions.

SamStephens commented 4 months ago

@tim-finnigan I still think this is effectively a deprecation; that existing usage will continue to be supported, but for new code we should avoid resources and use the lower level client where feature development will continue. "Existing interfaces will continue to operate during boto3’s lifecycle". Yes, but surely there will be a boto4 one day that does not include resources, now they're out of favour I cannot imagine you'll support resources indefinitely. Also, even on boto3 users are eventually going to find themselves needing newer AWS features that will never be supported by resources, and need to rewrite their resource using code using the lower level interface.

I kind of wish you did call this a deprecation. I just built a bunch of functionality using DynamoDB resources (because they're so superior to the lower level client experience), and it's a bit of a kick in the teeth to only then discover they're not fully supported anymore.

Feature requests related to the Boto3 resources interface are not prioritized because we are striving for more consistency among the AWS SDKs, so efforts involving new functionality in high-level interfaces would be better directed towards longer term cross-SDK solutions.

This is what I was looking for; an understanding of why the policy exists, and what we should expect for the development of higher level interfaces in the future now resources are no longer favored.

Are there any cross-SDK high-level interfaces already, or plans for any? Or is this TBD?

tim-finnigan commented 4 months ago

Thanks for following up and sharing your feedback. Just to be clear I'll repeat for emphasis that the resources interface in Boto3 is and will continue to be supported for the entirety of Boto3, but feature requests related to resources are not being prioritized. But we do recommend using the client methods in order to access the latest API functionality released by the DynamoDB service team.

Plans for future interfaces are still TBD. I'm sure the SDK teams will want to gather more feedback like this to inform future decisions around high-level interfaces, and I will share your feedback with our PM team. You can refer to the AWS Developer Tools Blog for announcements involving the SDKs. In the meantime I'll convert this to a discussion in the Q&A category which we recommend using for general questions.