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

Why is Key not required on ObjectTypeDef? #1

Open
zjtalia opened this issue Feb 7, 2025 · 0 comments
Open

Why is Key not required on ObjectTypeDef? #1

zjtalia opened this issue Feb 7, 2025 · 0 comments

Comments

@zjtalia
Copy link

zjtalia commented Feb 7, 2025

Looking at the code for the ObjectTypeDef dictionary:

class ObjectTypeDef(TypedDict):
    Key: NotRequired[str]
    LastModified: NotRequired[datetime]
    ETag: NotRequired[str]
    ChecksumAlgorithm: NotRequired[List[ChecksumAlgorithmType]]
    ChecksumType: NotRequired[ChecksumTypeType]
    Size: NotRequired[int]
    StorageClass: NotRequired[ObjectStorageClassType]
    Owner: NotRequired[OwnerTypeDef]
    RestoreStatus: NotRequired[RestoreStatusTypeDef]

Why is Key marked as NotRequired? When using list_objects_v2 for example, is there ever a scenario where the key for each listed object wouldn't be present? As far as can tell, the key should always be present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant