Repository navigation
Description
Detail Bug Report
Introduced in #140 on Sep 28, 2026
Summary
- Context:
AppendIndefiniteFailureError— a new exception introduced inbf927e9to signal that an append may have taken effect in an earlier attempt when the final attempt fails (the "preserve uncertainty across append retries" feature shipped in 0.12.0) — is not importable from the package root. - Bug:
from s2_sdk import AppendIndefiniteFailureErrorraisesImportErroratv0.12.0(HEAD =48e54f0). - Actual vs. expected: A user doing
from s2_sdk import AppendIndefiniteFailureErrorgetsImportError, whereas the feature shipped in 0.12.0 (per CHANGELOG) and every sibling S2 exception (S2Error,S2ClientError,S2ServerError,AppendConditionError,FencingTokenMismatchError,SeqNumMismatchError,ReadUnwrittenError) is importable froms2_sdk. - Impact: Only users who import-and-catch-the-specific-subclass by name from
s2_sdkare affected: they getImportError. The commonexcept S2Error:pattern is unaffected and still catches this exception.
Code with Bug
from s2_sdk._exceptions import (
AppendConditionError,
FencingTokenMismatchError,
ReadUnwrittenError,
S2ClientError,
S2Error,
S2ServerError,
SeqNumMismatchError,
) # <-- BUG 🔴 AppendIndefiniteFailureError is missing from public re-export__all__ = [
"S2Error",
"S2ClientError",
"S2ServerError",
"AppendConditionError",
"FencingTokenMismatchError",
"SeqNumMismatchError",
"ReadUnwrittenError",
] # <-- BUG 🔴 AppendIndefiniteFailureError is missing from __all__Explanation
AppendIndefiniteFailureError exists in s2_sdk._exceptions and can be raised on the public append path (via the retrier when append uncertainty is tracked), but it is not imported/re-exported from s2_sdk.__init__ and is not listed in s2_sdk.__all__. As a result, from s2_sdk import AppendIndefiniteFailureError fails even though other exception types are publicly importable from the package root.
Codebase Inconsistency
Project convention is to import SDK exception types from the package root (e.g., from s2_sdk import S2ClientError in tests), but tests that reference this specific exception import it from the private module s2_sdk._exceptions, so CI does not catch the missing public export.
Recommended Fix
Re-add the public re-export to src/s2_sdk/__init__.py by including AppendIndefiniteFailureError in the from s2_sdk._exceptions import (...) block and adding the matching entry to __all__.
History
This bug was introduced in commit 48e54f0 (release v0.12.0), which dropped the AppendIndefiniteFailureError entry from src/s2_sdk/__init__.py that had been added in bf927e9.
Activity