Skip to content

Commit ff8cfdd

Browse files
lint: restore D105 docstrings on magic methods and apply ruff-format
1 parent b2db501 commit ff8cfdd

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

pyiceberg/encryption/ciphers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ def decrypt_ags1_stream(key: bytes, encrypted_data: bytes, aad_prefix: bytes) ->
7373
raise ValueError(f"Truncated AGS1 block at offset {offset}: {block_cipher_size} bytes")
7474

7575
block = stream_data[offset : offset + block_cipher_size]
76-
result.extend(
77-
aesgcm.decrypt(block[:NONCE_LENGTH], block[NONCE_LENGTH:], stream_block_aad(aad_prefix, block_index))
78-
)
76+
result.extend(aesgcm.decrypt(block[:NONCE_LENGTH], block[NONCE_LENGTH:], stream_block_aad(aad_prefix, block_index)))
7977
offset += block_cipher_size
8078
block_index += 1
8179

pyiceberg/encryption/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def close(self) -> None:
4343
self._buffer.close()
4444

4545
def __enter__(self) -> BytesInputStream:
46+
"""Enter the context manager."""
4647
return self
4748

4849
def __exit__(
@@ -51,6 +52,7 @@ def __exit__(
5152
excinst: BaseException | None,
5253
exctb: TracebackType | None,
5354
) -> None:
55+
"""Exit the context manager and close the stream."""
5456
self.close()
5557

5658

@@ -60,6 +62,7 @@ def __init__(self, location: str, data: bytes) -> None:
6062
self._data = data
6163

6264
def __len__(self) -> int:
65+
"""Return the length of the underlying byte buffer."""
6366
return len(self._data)
6467

6568
def exists(self) -> bool:

pyiceberg/encryption/manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(
4343
self.properties = properties or {}
4444

4545
def __repr__(self) -> str:
46+
"""Return a string representation of the EncryptedKey."""
4647
return (
4748
f"EncryptedKey(key_id={self.key_id!r}, "
4849
f"encrypted_by_id={self.encrypted_by_id!r}, "

0 commit comments

Comments
 (0)