Repository navigation
Open
Labels
Description
Part of #1341 (decisions 3 to 6 of the audit).
Current state (29cc1d3)
- Response models in two styles and two modules: frozen dataclasses in
s3_core.py, property classes over raw dicts ins3_object.py. Checksum properties: 10 on parts, 4 onS3PutObject/S3CompleteMultipartUpload, none onS3Metadata.S3ObjectVersion.nameisbucket/key. S3Metadatais falsy without user metadata and compares equal to{}, the documented mapping behavior offs.metadata().copy_object,delete_objectandreplace_object_metadatareturn None.touch()returnsS3PutObject.to_dict(), keyed by private attribute names (_etag, ...). s3fs returns the raw PutObject response.S3Coremethods follow four**paramsprecedence rules: sent as given withTypeErroron a duplicate; the method's fields win (get_object,put_object, the multipart methods,list_object_annotations);paramswin over retained fields butTypeErrorfor the fields the copy sets (replace_object_metadata);paramswin over the path (generate_presigned_url).
Decision
- One module of models in one style, re-exported under the current names, with constructors that still accept response dictionaries. Checksum properties per operation as botocore defines them.
S3ObjectVersiongains a typedpath; itsnameis unchanged. Pickles of the old property classes need not load (release note). S3Metadatastays the result ofS3Core.head_objectandfs.metadata(); its truth value and equality are documented.copy_objectandreplace_object_metadatareturn anS3CopyObject(destination version ID, source version ID, ETag, last modified, checksums);delete_objectreturns anS3DeleteObject(version ID, delete marker).touch()returns the raw PutObject response, as s3fs (breaking).- One
**paramsrule: fields that a method derives from its arguments raiseTypeErrorwhen also given inparams; defaults that the method fills in (retained metadata,request_kwargs) yield toparams. The PR tabulates each method's derived fields (includingCopySourceRange,MultipartUpload, checksum and pagination fields), keeps documented fallbacks such asrange_=NonewithRange=, and normalizes the writer's internal calls (s3_writer.py:219) that forward checksum parameters (breaking where a method's field now raises or a parameter no longer wins).
The compatible consolidation (1-3) can land first; 4 and 5 go in the same release. Coordinate with #1373, which changes the append precedence over S3Object.to_api_repr().
Activity