You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Detail Bug] Python SDK: AppendIndefiniteFailureError cannot be imported from package root in v0.12.0 #143
Context: AppendIndefiniteFailureError — a new exception introduced in bf927e9 to 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 AppendIndefiniteFailureError raises ImportError at v0.12.0 (HEAD = 48e54f0).
Actual vs. expected: A user doing from s2_sdk import AppendIndefiniteFailureError gets ImportError, whereas the feature shipped in 0.12.0 (per CHANGELOG) and every sibling S2 exception (S2Error, S2ClientError, S2ServerError, AppendConditionError, FencingTokenMismatchError, SeqNumMismatchError, ReadUnwrittenError) is importable from s2_sdk.
Impact: Only users who import-and-catch-the-specific-subclass by name from s2_sdk are affected: they get ImportError. The common except S2Error: pattern is unaffected and still catches this exception.
Code with Bug
froms2_sdk._exceptionsimport (
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