Skip to content

Commit a6bcc1f

Browse files
Update stale docstrings
- Reflect the opt-in bucket lifecycle flags in the S3FileSystem class docstring and makedirs - Mention the metadata/tagging/ACL support, incomplete-upload management, and error translation in the feature list - Document the ListMultipartUploads fields on S3MultipartUpload Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e9b147c commit a6bcc1f

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

pyathena/filesystem/s3.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,24 @@ class S3FileSystem(AbstractFileSystem):
5353
- Listing objects and directories
5454
- Reading and writing files
5555
- Copying and moving objects
56-
- Creating and removing directories
57-
- Multipart uploads for large files
56+
- Reading and writing object metadata, tags, and canned ACLs
57+
- Multipart uploads for large files, including management of
58+
incomplete uploads
59+
- Creating and removing buckets (disabled by default; see
60+
``allow_bucket_creation`` / ``allow_bucket_deletion``)
5861
- Various S3 storage classes and encryption options
62+
- Translating S3 error responses into standard Python exceptions
63+
(e.g., ``404`` -> ``FileNotFoundError``, ``403`` -> ``PermissionError``)
5964
6065
Attributes:
6166
session: The boto3 session used for S3 operations.
6267
client: The S3 client for direct API calls.
6368
config: Boto3 configuration for the client.
6469
retry_config: Configuration for retry behavior on failed operations.
70+
allow_bucket_creation: Whether mkdir/makedirs may create buckets.
71+
Defaults to False.
72+
allow_bucket_deletion: Whether rmdir may delete buckets.
73+
Defaults to False.
6574
6675
Example:
6776
>>> from pyathena.filesystem.s3 import S3FileSystem
@@ -829,10 +838,19 @@ def mkdir(self, path: str, create_parents: bool = True, **kwargs) -> None:
829838
def makedirs(self, path: str, exist_ok: bool = False) -> None:
830839
"""Recursively create a directory, creating the bucket if necessary.
831840
841+
Creating the bucket requires ``allow_bucket_creation=True`` on the
842+
filesystem constructor; see :meth:`mkdir`.
843+
832844
Args:
833845
path: S3 path (e.g., "s3://bucket" or "s3://bucket/prefix").
834846
exist_ok: If False, raise FileExistsError when the path is a
835847
bucket that already exists.
848+
849+
Raises:
850+
FileExistsError: If the path is a bucket that already exists and
851+
``exist_ok`` is False.
852+
PermissionError: If the bucket would be created but bucket
853+
creation is not enabled on this filesystem instance.
836854
"""
837855
try:
838856
self.mkdir(path, create_parents=True)

pyathena/filesystem/s3_object.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,12 @@ class S3MultipartUpload:
447447
upload_id: Unique identifier for the multipart upload.
448448
server_side_encryption: Encryption method applied to the upload.
449449
abort_date/abort_rule_id: Lifecycle rule information for upload cleanup.
450+
initiated/storage_class/owner/initiator: Fields returned by the
451+
ListMultipartUploads API for in-progress uploads.
450452
451453
Note:
452-
Used internally by S3FileSystem for large file upload operations.
454+
Used internally by S3FileSystem for large file upload operations,
455+
and returned by ``S3FileSystem.list_multipart_uploads``.
453456
"""
454457

455458
def __init__(self, response: dict[str, Any]) -> None:

0 commit comments

Comments
 (0)